Created
May 6, 2026 16:26
-
-
Save hl2guide/3aca0466f05f2b9462b95ccf041d8b5f to your computer and use it in GitHub Desktop.
Clears temp files in Windows 11. Close all running apps before running it.
This file contains hidden or 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
| # Clears the Windows temp folder (current) | |
| $TempFolder = "$env:TEMP" | |
| Remove-Item -Path "$TempFolder\*" -Recurse -Force ` | |
| -ErrorAction SilentlyContinue | |
| Write-Host | |
| Write-Host "Cleared temp folders in: $env:TEMP" -ForegroundColor Cyan | |
| Write-Host |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment