PowerTip: Use PowerShell to List Only Directories

PowerTip: Use PowerShell to List Only Directories

  • Comments 1
  • Likes

Summary: Learn how to use Windows PowerShell to show all directories.

Hey, Scripting Guy! Question How can I use Windows PowerShell to list ONLY directories in a folder structure?

Hey, Scripting Guy! Answer Use Get-ChildItem on the target folder and specify the Directory parameter:

Get-ChildItem C:\Foo –recurse -directory

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment
  • Is this applicable for Powershell 2.0, doesnt seem to work