Created
November 27, 2019 14:55
-
-
Save martea/0769cd90281b1e6ba801f30cfa1b701f to your computer and use it in GitHub Desktop.
Remove files older than 30 days
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
Get-ChildItem -r | ?{ !$_.PSIsContainer } | ?{ $_.LastWriteTime -LT (Get-Date).AddDays(-30)} | Remove-Item -Verbose |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment