<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.technet.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>Use PowerShell to Explore Nested Directories and Files</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2012/07/30/use-powershell-to-explore-nested-directories-and-files.aspx</link><description>The Microsoft Scripting Guy talks about using the Get-ChildItem cmdlet to find, sort, and count folders.</description><dc:language>en-US</dc:language><generator>Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><item><title>re: Use PowerShell to Explore Nested Directories and Files</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2012/07/30/use-powershell-to-explore-nested-directories-and-files.aspx#3511720</link><pubDate>Tue, 31 Jul 2012 13:22:41 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3511720</guid><dc:creator>Ed Wilson</dc:creator><description>&lt;p&gt;@K_Schulte certainly I could divide by 52 ... and that would work for my specific scenario, but might not help out someone else who did not have as structured a filesystem. In PowerShell 3.0 there is a -directory switch that will return only directories, and there is a -file switch that will return only files. In addition, there is a -attributes that allows you to specify specific file attributes, as well as a -hidden, -readonly and -system switches. There is no -link switch however.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3511720" width="1" height="1"&gt;</description></item><item><title>re: Use PowerShell to Explore Nested Directories and Files</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2012/07/30/use-powershell-to-explore-nested-directories-and-files.aspx#3511473</link><pubDate>Mon, 30 Jul 2012 07:21:21 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3511473</guid><dc:creator>K_Schulte</dc:creator><description>&lt;p&gt;correction:&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve been to fast ( and too furious :-) I missed &amp;nbsp;to add the &amp;quot;Count&amp;quot; property in the end!&lt;/p&gt;
&lt;p&gt;(Get-ChildItem -Path C:\data\ScriptingGuys -recurse | where {$_.psiscontainer -AND $_.name -match &amp;#39;^D&amp;#39;} | measure).count / 52&lt;/p&gt;
&lt;p&gt;Klaus.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3511473" width="1" height="1"&gt;</description></item><item><title>re: Use PowerShell to Explore Nested Directories and Files</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2012/07/30/use-powershell-to-explore-nested-directories-and-files.aspx#3511470</link><pubDate>Mon, 30 Jul 2012 07:14:40 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3511470</guid><dc:creator>K_Schulte</dc:creator><description>&lt;p&gt;Hi Ed,&lt;/p&gt;
&lt;p&gt;a nice article about the secrets of the &amp;quot;get-Childitem&amp;quot; CmdLet!&lt;/p&gt;
&lt;p&gt;But .. if I may dare to ask the question ... why don&amp;#39;t we just count the matching &amp;nbsp;folders and divide them by the number of weeks per year? Like:&lt;/p&gt;
&lt;p&gt;(Get-ChildItem -Path C:\data\ScriptingGuys -recurse | where {$_.psiscontainer -AND $_.name -match &amp;#39;^hsg&amp;#39;} | measure) / 52&lt;/p&gt;
&lt;p&gt;This would optimize the runtime ... wouldn&amp;#39;t it *ssss* :-)&lt;/p&gt;
&lt;p&gt;And I&amp;#39;m still convinced that the introduction of -Directory ( -File, -Link, ... ) switch would help, if it were available for the &amp;quot;Get-ChildItem&amp;quot; CmdLet!&lt;/p&gt;
&lt;p&gt;Klaus.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3511470" width="1" height="1"&gt;</description></item></channel></rss>