Skip to content

Instantly share code, notes, and snippets.

@y0ug
Created November 10, 2014 14:54
Show Gist options
  • Save y0ug/6f2aa2b3fa227dc4c2b3 to your computer and use it in GitHub Desktop.
Save y0ug/6f2aa2b3fa227dc4c2b3 to your computer and use it in GitHub Desktop.
# Clean temp folder
$tempfolders = @("C:\Windows\Temp\*", "C:\Windows\Prefetch\*", "C:\Documents and Settings\*\Local Settings\temp\*", "C:\Users\*\Appdata\Local\Temp\*")
Remove-Item $tempfolders -force -recurse
# Clean windows update folder
Stop-Service wuauserv
dir $env:windir\SoftwareDistribution\Download -Recurse | Remove-Item 'Recurse
#Start-Service wuauserv
# Remove hybernation file
Remove-Item c:\hiberfil.sys -force
# Remove evtx log
#$es=new-object System.Diagnostics.Eventing.Reader.EventlogSession
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment