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

Practical How-To

list files

list dirs

on dir

on file

Windows config

zip tar

misc


PowerShell in Depth

Programing PowerShell

Value Types

String

Variable

Boolean

Conditional

Data Structure

Loop and Iteration

Input/Output

Function

Profile and Script

Script Examples