Skip to content

Instantly share code, notes, and snippets.

@brandonweeks
Created December 5, 2014 04:53
Show Gist options
  • Save brandonweeks/0c55098a6eb05cea5d72 to your computer and use it in GitHub Desktop.
Save brandonweeks/0c55098a6eb05cea5d72 to your computer and use it in GitHub Desktop.
Clean Windows NPS logs
$files = Get-ChildItem "C:\Windows\system32\LogFiles" -Filter *.log
$len = $files.length - 2
foreach ($file in $files[0..$len]) {
Remove-Item $file.FullName
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment