Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Get-ChildItem $directory -Directory -Recurse -Force |
Sort-Object -Property FullName -Descending |
Where-Object { $($_ | Get-ChildItem -Force | Select-Object -First 1).Count -eq 0 } |
Remove-Item
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment