<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>BaseName for FileInfo objects</title><link>http://blogs.msdn.com/powershell/archive/2006/06/24/645981.aspx</link><description>&amp;lt;Edited to add categories&amp;gt; In our active, responsive, and useful newsgroup Microsoft.Public.Windows.PowerShell (SELL SELL SELL :-) ), MVP Alex Angelopoulos recented posted the following: Although file extension changing is a common technique in</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>re: BaseName for FileInfo objects</title><link>http://blogs.msdn.com/powershell/archive/2006/06/24/645981.aspx#646031</link><pubDate>Sun, 25 Jun 2006 00:30:07 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:646031</guid><dc:creator>jvierra</dc:creator><description>I agree. &amp;nbsp;If we can add it as a type that should be good for now. &amp;nbsp;Perhaps the typing that may be included in future releases shouyld be mediated by the PS Team. &amp;nbsp;A standard for adding types and documenting them so that when they are included in the release nothing will break.&lt;br&gt;&lt;br&gt;I would much rather see an AD provider take shape. While we can use AD through NET Framework or COM it would be far better to have a full PS provider for ADSI.&lt;br&gt;&lt;br&gt;How has Exchange managed to survive without an ADSI provider? &amp;nbsp;Are they building all of it into the Exchange provider?&lt;br&gt;</description></item><item><title>re: BaseName for FileInfo objects</title><link>http://blogs.msdn.com/powershell/archive/2006/06/24/645981.aspx#646139</link><pubDate>Sun, 25 Jun 2006 03:01:32 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:646139</guid><dc:creator>Alex K. Angelopoulos</dc:creator><description>After some volleying with Jacques Barathon, there's a slightly improved version of the code block which correctly handles files which have no extension or names that begin with a period:&lt;br&gt;####&lt;br&gt;&lt;br&gt;if ( ($this.extension.length -gt 0)&lt;br&gt; &amp;nbsp; &amp;nbsp;-and ($this.extension.length -lt this.Name.length) )&lt;br&gt;{&lt;br&gt; &amp;nbsp; &amp;nbsp;$this.Name.Remove($this.Name.Length - $this.Extension.Length)&lt;br&gt;}&lt;br&gt;else&lt;br&gt;{&lt;br&gt; &amp;nbsp; &amp;nbsp;$this.Name&lt;br&gt;}&lt;br&gt;</description></item><item><title>re: BaseName for FileInfo objects</title><link>http://blogs.msdn.com/powershell/archive/2006/06/24/645981.aspx#646284</link><pubDate>Sun, 25 Jun 2006 05:44:56 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:646284</guid><dc:creator>KeithH</dc:creator><description>Regarding a naming convention, you probably already know that I'm not a fan of &amp;quot;My.&amp;quot; anything. Besides the customized types.ps1xml I use is located in the PSConfiguration folder. &amp;nbsp;I think this is where all customization files should go. &amp;nbsp;I don't think it is a good idea to have folks place customized files in PowerShell's install dir. &amp;nbsp;On Vista, depending on how you try to write to the Program Files dir the modification may or may not get virtualized.</description></item><item><title>re: BaseName for FileInfo objects</title><link>http://blogs.msdn.com/powershell/archive/2006/06/24/645981.aspx#647392</link><pubDate>Mon, 26 Jun 2006 17:19:03 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:647392</guid><dc:creator>Singee15</dc:creator><description>I think that 'User' would be an appropriate prefix for all user-defined extensions. &lt;br&gt;&lt;br&gt;This avoids the overused and inappropreate use of 'My' and replaces it with an accurate and descriptive prefix.</description></item><item><title>Using FFMPEG to squish lots of videos using PowerShell</title><link>http://blogs.msdn.com/powershell/archive/2006/06/24/645981.aspx#654239</link><pubDate>Sun, 02 Jul 2006 12:26:46 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:654239</guid><dc:creator>ComputerZen.com - Scott Hanselman</dc:creator><description /></item><item><title>re: BaseName for FileInfo objects</title><link>http://blogs.msdn.com/powershell/archive/2006/06/24/645981.aspx#665235</link><pubDate>Fri, 14 Jul 2006 06:34:37 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:665235</guid><dc:creator>lb</dc:creator><description>this is nifty! love the user-extensibility of powerShell. Heck i love everything about it.&lt;br&gt;&lt;br&gt;got any advice/ideas about handling for: &amp;quot;cascading file types&amp;quot;. &lt;br&gt;&lt;br&gt;say, your example file &amp;quot;MSH.xshd.orig&amp;quot; above --well under a 'cascading file types' scenario, this could be opened/viewed/(etc) by either:&lt;br&gt; &amp;nbsp;1. the apps that handle the 'xshd' extension&lt;br&gt;or:&lt;br&gt; &amp;nbsp;2. &amp;nbsp;the apps that handle the 'orig' extension {pretending this is a genuine file type}&lt;br&gt;&lt;br&gt;what sort of support could ps offer for this cascading file types model?&lt;br&gt;&lt;br&gt;currently i'm thinking of just doing up a windows context menu enhancement for it... but now i see that powerShell could offer support too.&lt;br&gt;&lt;br&gt;more about it here:&lt;br&gt;&lt;a rel="nofollow" target="_new" href="http://secretgeek.net/multiformats.asp"&gt;http://secretgeek.net/multiformats.asp&lt;/a&gt;&lt;br&gt;&lt;br&gt;lb&lt;br&gt;&lt;br&gt;</description></item><item><title>re: BaseName for FileInfo objects</title><link>http://blogs.msdn.com/powershell/archive/2006/06/24/645981.aspx#665276</link><pubDate>Fri, 14 Jul 2006 07:21:56 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:665276</guid><dc:creator>PowerShellTeam</dc:creator><description>RE: Cascading file types&lt;br&gt;&lt;br&gt;What you could do in this case is to have a ScriptMethod that you call to examine the object and dynamically add properties to itself.&lt;br&gt;Add the following ScriptMethod to the FileInfo Type extension and you'll be able to do the example below. &amp;nbsp;You just add your own logic:&lt;br&gt;&lt;br&gt; &amp;nbsp; &amp;nbsp;&amp;lt;ScriptMethod&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;Name&amp;gt;AddCascadingFileTypes&amp;lt;/Name&amp;gt;&lt;br&gt; &amp;nbsp; &amp;nbsp; &amp;lt;Script&amp;gt;&lt;br&gt;$basename,$extensions = $this.Name.Split(&amp;quot;.&amp;quot;)&lt;br&gt;foreach ($e in $extensions)&lt;br&gt;{&lt;br&gt; &amp;nbsp; $this |Add-Member -type NoteProperty -Name (&amp;quot;ADDEDPROPERTY&amp;quot;+$e) -value $e&lt;br&gt;}&lt;br&gt; &amp;nbsp; &amp;nbsp; &amp;lt;/Script&amp;gt;&lt;br&gt; &amp;nbsp; &amp;nbsp;&amp;lt;/ScriptMethod&amp;gt;&lt;br&gt;&lt;br&gt;PS&amp;gt; dir a.b*&lt;br&gt;&lt;br&gt;&lt;br&gt; &amp;nbsp; &amp;nbsp;Directory: Microsoft.PowerShell.Core\FileSystem::C:\Temp&lt;br&gt;&lt;br&gt;&lt;br&gt;Mode &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;LastWriteTime &amp;nbsp; &amp;nbsp; Length Name&lt;br&gt;---- &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;------------- &amp;nbsp; &amp;nbsp; ------ ----&lt;br&gt;-a--- &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 7/13/2006 &amp;nbsp; 9:17 PM &amp;nbsp; &amp;nbsp; &amp;nbsp;17432 a.b.c.d.e.f.g&lt;br&gt;&lt;br&gt;&lt;br&gt;PS&amp;gt; $x=(dir a.b*)&lt;br&gt;PS&amp;gt; $x.AddCascadingFileTypes()&lt;br&gt;PS&amp;gt; $x |fl a*&lt;br&gt;&lt;br&gt;&lt;br&gt;ADDEDPROPERTYb : b&lt;br&gt;ADDEDPROPERTYc : c&lt;br&gt;ADDEDPROPERTYd : d&lt;br&gt;ADDEDPROPERTYe : e&lt;br&gt;ADDEDPROPERTYf : f&lt;br&gt;ADDEDPROPERTYg : g&lt;br&gt;Attributes &amp;nbsp; &amp;nbsp; : Archive&lt;br&gt;&lt;br&gt;Jeffrey Snover [MSFT]&lt;br&gt;Windows PowerShell/Aspen Architect&lt;br&gt;Visit the Windows PowerShell Team blog at: &amp;nbsp; &amp;nbsp;&lt;a rel="nofollow" target="_new" href="http://blogs.msdn.com/PowerShell"&gt;http://blogs.msdn.com/PowerShell&lt;/a&gt;&lt;br&gt;Visit the Windows PowerShell ScriptCenter at: &amp;nbsp;&lt;a rel="nofollow" target="_new" href="http://www.microsoft.com/technet/scriptcenter/hubs/msh.mspx"&gt;http://www.microsoft.com/technet/scriptcenter/hubs/msh.mspx&lt;/a&gt;</description></item><item><title>Suggestion: Add a Basename property to System.IO.FileInfo | keyongtech</title><link>http://blogs.msdn.com/powershell/archive/2006/06/24/645981.aspx#9361765</link><pubDate>Thu, 22 Jan 2009 05:49:22 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9361765</guid><dc:creator>Suggestion: Add a Basename property to System.IO.FileInfo | keyongtech</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://www.keyongtech.com/2831366-suggestion-add-a-basename-property"&gt;http://www.keyongtech.com/2831366-suggestion-add-a-basename-property&lt;/a&gt;&lt;/p&gt;
</description></item></channel></rss>