Last active
March 14, 2022 15:57
-
-
Save JohnL4/affad64b6e3c3d2ecf13d5dece2e6fb3 to your computer and use it in GitHub Desktop.
File cleanup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$mb = 1024*1024 | |
$days60 = (Get-Date).AddDays(-60) | |
ls | ? {($_.Length -gt 180*$mb) -and ($_.LastWriteTime -lt $days60)} | |
# Can pipe above cmd to 'rm -vb' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment