| @@ -0,0 +1,5 @@ | |||
| 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 | |
michelgentile / Housekeep folder
Last active 6 months ago
michelgentile
revised this gist 10 months ago
·
56187c3
No changes
michelgentile
revised this gist 10 months ago
·
11d6907
1 file changed, 5 insertions