Created
July 17, 2023 06:17
-
-
Save mu88/ad3b8806c196ccc06cf6e1fcf3404689 to your computer and use it in GitHub Desktop.
Clean temporary dev stuff
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
$Continue = Read-Host "Do you want to continue? Enter 'Yes'" | |
if ($Continue -ne "Yes") { | |
exit | |
} | |
if (([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator") -ne $true) { | |
Write-Host "Run this script as admin" | |
exit | |
} | |
docker stop $(docker ps -q) | |
docker container prune | |
docker network prune | |
docker volume prune | |
docker image prune | |
docker system prune -a | |
Read-Host "Stop Docker for Desktop and press Enter" | |
wsl --shutdown | |
optimize-vhd -Path $env:LOCALAPPDATA\Docker\wsl\data\ext4.vhdx -Mode full | |
nuget locals all -clear | |
Remove-Item -r $env:USERPROFILE\.gradle\caches | |
Remove-Item -r $env:LOCALAPPDATA\Temp\chocolatey |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment