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

Discussion is closed.

Feedback usabilla icon