Last active
July 22, 2018 21:47
-
-
Save robert-moses/98a16994f62b85a9c9ae8226d6697bf0 to your computer and use it in GitHub Desktop.
POSH, clean up log file (IIS, etc)
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
# Replace path with the path you want, include file name pattern/etc | |
# Replace time/age with what you want | |
# add this as a schedule task. | |
Get-ChildItem C:\Inetpub\logs* -Include u_ex*.log -Recurse | Where-Object {$_.LastWriteTime -lt (Get-Date).AddDays(-30)} | Remove-Item |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment