June 19th, 2013

PowerTip: Use a PowerShell 3.0 Switch to Find Only Directories

Doctor Scripto
Scripter

Summary: Use a switch in Windows PowerShell 3.0 to easily find only directories.

Hey, Scripting Guy! Question How can I use Windows PowerShell 3.0 to find a list of only directories from my current location?

 Hey, Scripting Guy! Answer Use the –Directory switch with the Get-ChildItem cmdlet.

Get-ChildItem -Directory

Note  The –Directory switch was added to Windows PowerShell 3.0.

Author

The "Scripting Guys" is a historical title passed from scripter to scripter. The current revision has morphed into our good friend Doctor Scripto who has been with us since the very beginning.

0 comments

Discussion are closed.