rcaldous revisó este gist 1 year ago. Ir a la revisión
1 file changed, 5 insertions
deleteEmpty.ps1(archivo creado)
| @@ -0,0 +1,5 @@ | |||
| 1 | + | $LogPath = Read-Host 'Path to delete empty folders' | |
| 2 | + | Get-ChildItem -LiteralPath $LogPath -Force -Recurse | Where-Object { | |
| 3 | + | $_.PSIsContainer -and ` | |
| 4 | + | @(Get-ChildItem -LiteralPath $_.Fullname -Force -Recurse | Where { -not $_.PSIsContainer }).Count -eq 0 } | | |
| 5 | + | Remove-Item -Recurse | |
Siguiente
Anterior