<?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>Windows PowerShell One-Liner:  List all the subdirectories in the current directory</title><link>http://blogs.msdn.com/b/powershell/archive/2006/06/24/645000.aspx</link><description>dir | where {$_.PsIsContainer} 
 Alternatively you could: 
 dir |where {$_.mode -match "d"} 
 Jeffrey Snover Windows PowerShell Architect</description><dc:language>en-US</dc:language><generator>Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><item><title>re: Windows PowerShell One-Liner:  List all the subdirectories in the current directory</title><link>http://blogs.msdn.com/b/powershell/archive/2006/06/24/645000.aspx#9938788</link><pubDate>Fri, 18 Dec 2009 16:31:09 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9938788</guid><dc:creator>Scott</dc:creator><description>&lt;p&gt;How do you get PW to delete the tmp directories stored under c:\user\userID\AppData\local\temp&lt;/p&gt;
&lt;p&gt;where userID is the user's directory?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9938788" width="1" height="1"&gt;</description></item><item><title>re: Windows PowerShell One-Liner:  List all the subdirectories in the current directory</title><link>http://blogs.msdn.com/b/powershell/archive/2006/06/24/645000.aspx#8540920</link><pubDate>Fri, 23 May 2008 22:08:13 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8540920</guid><dc:creator>Jason</dc:creator><description>&lt;p&gt;I agree with Eric. &amp;nbsp;There should be some shortcuts or something. &amp;nbsp;I'm having trouble getting a certain property from a directory after doing this... should be simpler. &amp;nbsp;I know it can be done, but why does it have to be so complicated?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8540920" width="1" height="1"&gt;</description></item><item><title>re: Windows PowerShell One-Liner:  List all the subdirectories in the current directory</title><link>http://blogs.msdn.com/b/powershell/archive/2006/06/24/645000.aspx#8432980</link><pubDate>Mon, 28 Apr 2008 00:19:20 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8432980</guid><dc:creator>Eric</dc:creator><description>&lt;p&gt;This is ~one~ of my biggest gripes against powershell:&lt;/p&gt;
&lt;p&gt;get-childitem | where {$_.mode -match &amp;quot;d&amp;quot;}&lt;/p&gt;
&lt;p&gt;versus&lt;/p&gt;
&lt;p&gt;dir /AD&lt;/p&gt;
&lt;p&gt;One of them is quick and efficient to type; the other tedious, wordy, aggravating. &amp;nbsp;&lt;/p&gt;
&lt;p&gt;If everyone has to alias everything just to work efficiently on a command line, then really: what benefit is the overly-lengthy Verb-Noun syntax coupled with long switches (&amp;quot;silentlycontinue&amp;quot;?!)? &amp;nbsp;&lt;/p&gt;
&lt;p&gt;As a system admin who can also program in a handful of languages, I feel Powershell lost sight of being a command line interface for SAs.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8432980" width="1" height="1"&gt;</description></item><item><title>my $.5</title><link>http://blogs.msdn.com/b/powershell/archive/2006/06/24/645000.aspx#649518</link><pubDate>Wed, 28 Jun 2006 13:17:23 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:649518</guid><dc:creator>b3ardman</dc:creator><description>This is my oneliner that gets items in the current directory that are older than the newest item. I use this to backup old IIS logs.&lt;br&gt;&lt;br&gt;dir | where { !$_.PsIsContainer } | where { $_.Name -ne (dir | where { !$_.PSIsContainer } | sort LastWriteTime -descending | select -first 1 | %{$_.Name} ) } | %{ $_.FullName }&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=649518" width="1" height="1"&gt;</description></item><item><title>re: Windows PowerShell One-Liner:  List all the subdirectories in the current directory</title><link>http://blogs.msdn.com/b/powershell/archive/2006/06/24/645000.aspx#645807</link><pubDate>Sat, 24 Jun 2006 18:46:32 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:645807</guid><dc:creator>MSDNArchive</dc:creator><description>Thanks Keith! &lt;br&gt;&lt;br&gt;I've now added these to my startup profile. &amp;nbsp;I changed dirw to do autosizing to allow use of wide screens:&lt;br&gt;&lt;br&gt;function dirw &amp;nbsp;{ get-childitem $args -ea silentlycontinue | sort @{e={$_.PSIsContainer}; asc=$false},@{e={$_.Name}; asc=$true} | format-wide -auto}&lt;br&gt;&lt;br&gt;(I love community efforts - they make me smarter faster!) &lt;br&gt;&lt;br&gt;Jeffrey Snover [MSFT]&lt;br&gt;Windows PowerShell Architect&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=645807" width="1" height="1"&gt;</description></item><item><title>re: Windows PowerShell One-Liner:  List all the subdirectories in the current directory</title><link>http://blogs.msdn.com/b/powershell/archive/2006/06/24/645000.aspx#645244</link><pubDate>Sat, 24 Jun 2006 07:56:57 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:645244</guid><dc:creator>Keith Hill MVP</dc:creator><description>I have a number of dir* functions that I create in my profile:&lt;br&gt;&lt;br&gt;function dir &amp;nbsp; { get-childitem $args -ea silentlycontinue | sort @{e={$_.PSIsContainer}; asc=$false},@{e={$_.Name}; asc=$true} }&lt;br&gt;function dirw &amp;nbsp;{ get-childitem $args -ea silentlycontinue | sort @{e={$_.PSIsContainer}; asc=$false},@{e={$_.Name}; asc=$true} | format-wide }&lt;br&gt;function dirs &amp;nbsp;{ get-childitem $args -ea silentlycontinue | sort Length } &lt;br&gt;function dirt &amp;nbsp;{ get-childitem $args -ea silentlycontinue | sort LastWriteTime } &lt;br&gt;function dird &amp;nbsp;{ get-childitem $args -ea silentlycontinue | where { $_.PSIsContainer } }&lt;br&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=645244" width="1" height="1"&gt;</description></item></channel></rss>