Skip to content

Instantly share code, notes, and snippets.

View bishopsmove's full-sized avatar
🎯
Focusing

Jim Ownby bishopsmove

🎯
Focusing
View GitHub Profile
### Run this script on Windows (outside of the devcontainer!) to clear out Docker data and shrink the Docker VHD.
# Check if running as administrator, if not, relaunch as admin
if (-NOT ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) {
Write-Host "Script requires administrator privileges. Relaunching as administrator..." -ForegroundColor Yellow
# Get the current script path
$scriptPath = $MyInvocation.MyCommand.Path
#check if powershell-core is available, else use older Powershell