Created
July 13, 2018 09:45
-
-
Save martea/9abd08b5b4d947571da35fd998cd7c0f to your computer and use it in GitHub Desktop.
Clear log files recursively
This file contains 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 *.log | where FullName -Match "\\(log|logs)\\" | where 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