Quantcast
Channel: TechNet Blogs
Viewing all articles
Browse latest Browse all 34890

PowerTip: Quickly Show Folders and Subfolders in PowerShell 3.0

$
0
0

Summary: Use Windows PowerShell 3.0 to quickly show folders and subfolders.

Hey, Scripting Guy! Question How can I use Windows PowerShell 3.0 to quickly show folders and subfolders?

Hey, Scripting Guy! Answer Use the Get-ChildItem cmdlet with the –Directory and the –Recurse switch. Select only parent and name. This command is shown here. Sort on the parent property. 

gci -Recurse -Directory | select parent, name | sort parent

Note  gci is an alias for Get-ChildItemselect is an alias for Select-Object, and sort is an alias for Sort-Object.

 


Viewing all articles
Browse latest Browse all 34890

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>