Windows PowerShell One-Liner: List all the subdirectories in the current directory

PowerShell Team

dir | where {$_.PsIsContainer}

Alternatively you could:

dir |where {$_.mode -match “d”}

Jeffrey Snover
Windows PowerShell Architect

0 comments

Comments are closed. Login to edit/delete your existing comments

Feedback usabilla icon