Last active 6 months ago
PowerShell
0
0
1
| 1 | #Remove files older than... |
| 2 | Get-ChildItem -File -Recurse | Where-Object { $_.LastWriteTime -lt (Get-Date).AddDays(-180) } | Remove-Item -Force |
| 3 | |
| 4 | #Remove empty folders (may be repeated up to X times...) |
| 5 | Get-ChildItem -Directory -Recurse | Where-Object { -not (Get-ChildItem -Path $_.FullName -Recurse -Force -ErrorAction SilentlyContinue) } | Remove-Item -Force |