PowerShell: List Empty Directories

By Xah Lee. Date: .

List Empty Directories

dir -Directory -Recurse | where { $_.GetFileSystemInfos().Count -eq 0 } | foreach { $_.FullName }

Delete Empty Directories

dir -Directory -Recurse | where { $_.GetFileSystemInfos().Count -eq 0 } | rm

PowerShell, Working with Directory


PowerShell How-To

Install and Help

list files

list dirs

on dir

on file

Windows config

zip tar

misc