I\'m using PowerShell 2.0 and I want to pipe out all the subdirectories of a certain path. The following command outputs all files and directories, but I can\'t figure out h
To answer the original question specifically (using IO.FileAttributes):
Get-ChildItem c:\mypath -Recurse | Where-Object {$_.Attributes -and [IO.FileAttributes]::Directory}
I do prefer Marek's solution though (Where-Object { $_ -is [System.IO.DirectoryInfo] }).
Where-Object { $_ -is [System.IO.DirectoryInfo] }