Skip to content

Instantly share code, notes, and snippets.

@mu88
Created July 17, 2023 06:17
Show Gist options
  • Save mu88/ad3b8806c196ccc06cf6e1fcf3404689 to your computer and use it in GitHub Desktop.
Save mu88/ad3b8806c196ccc06cf6e1fcf3404689 to your computer and use it in GitHub Desktop.
Clean temporary dev stuff
$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