Skip to content

Instantly share code, notes, and snippets.

@martea
Created July 13, 2018 09:45
Show Gist options
  • Save martea/9abd08b5b4d947571da35fd998cd7c0f to your computer and use it in GitHub Desktop.
Save martea/9abd08b5b4d947571da35fd998cd7c0f to your computer and use it in GitHub Desktop.
Clear log files recursively
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