Skip to content

Instantly share code, notes, and snippets.

@aplocher
Created May 30, 2015 02:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aplocher/2265e5e06c7f47ec85fb to your computer and use it in GitHub Desktop.
Save aplocher/2265e5e06c7f47ec85fb to your computer and use it in GitHub Desktop.
PowerShell command to clean temp folder (only if the file or folder hasn't been touched in the last 2 days)
Get-ChildItem $env:temp | Where-Object {$_.LastWriteTime -lt (Get-Date).AddDays(-2)} | Remove-Item -Force -Recurse
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment