PowerShell
Public
Remove Empty Folders
Remove empty folders under the current directory.
#powershell
#folders
#cleanup
#windows
PowerShell
Get-ChildItem -Directory -Recurse |
Sort-Object FullName -Descending |
Where-Object { -not (Get-ChildItem -Path $_.FullName -Force) } |
Remove-Item -Force
Notes
This removes only empty folders. Test it in a safe folder first.