Save this script as windows-provisioning.ps1 and run it from an elevated (Administrator) PowerShell terminal. Simply adjust the boolean toggles at the top of the file to deploy the exact environment you need before executing.
# ==============================================================================
# Windows 11 Automated Provisioning Script
# Profiles: Baseline / Java Backend Workstation / Gaming PC
# ==============================================================================
# --- Configuration Toggles ---
$InstallDevTools = $true
$InstallGamingTools = $false
Set-ExecutionPolicy Bypass -Scope Process -Force
Write-Host "Updating WinGet sources..."
winget source update | Out-Null
# 1. Baseline Apps (Always Installed)
$Apps = @(
"Brave.Brave", "Mozilla.Firefox", "Mozilla.Thunderbird",
"Microsoft.WindowsTerminal", "Git.Git", "PuTTY.PuTTY",
"Microsoft.PowerToys", "Microsoft.SysinternalsSuite", "CPUID.HWMonitor",
"7zip.7zip", "AntibodySoftware.WizTree", "CodeSector.TeraCopy",
"RevoUninstaller.RevoUninstaller", "KrzysztofKowalczyk.SumatraPDF", "AcroSoftware.CutePDFWriter",
"Spotify.Spotify", "VideoLAN.VLC"
)
# 2. Gaming Overlay
if ($InstallGamingTools) {
$Apps += @(
"Valve.Steam", "Discord.Discord", "CXWorld.CapFrameX",
"Guru3D.Afterburner", "Obsidian.Obsidian"
)
}
# 3. Dev Overlay
if ($InstallDevTools) {
$Apps += @(
"WinSCP.WinSCP", "GitHub.cli", "HTTPie.HTTPie",
"BurntSushi.ripgrep", "junegunn.fzf", "sharkdp.fd", "stedolan.jq", "MikeFarah.yq",
"JetBrains.Toolbox", "JetBrains.IntelliJIDEA.Ultimate",
"Apache.Maven", "EclipseAdoptium.Temurin.17.JDK", "EclipseAdoptium.Temurin.21.JDK",
"OpenJS.NodeJS.LTS"
)
}
# 4. Standard Installation Loop
foreach ($App in $Apps) {
Write-Host "Installing: $App"
winget install --id $App --accept-package-agreements --accept-source-agreements --silent
}
# 5. Specialized Installs & Configurations
if ($InstallDevTools) {
# Pinned to last pre-login-gate build; remove --version to track latest
Write-Host "Installing: Insomnia v2023.5.8"
winget install --id Insomnia.Insomnia --version "2023.5.8" --accept-package-agreements --accept-source-agreements --silent
# Claude Code and Codex CLI are npm-distributed; Node must be installed first.
# Refresh PATH so npm is available in this session without a shell restart.
Write-Host "Refreshing PATH for current session..."
$env:Path = [System.Environment]::GetEnvironmentVariable("Path", "Machine") + ";" +
[System.Environment]::GetEnvironmentVariable("Path", "User")
$NpmCmd = Get-Command npm -ErrorAction SilentlyContinue
if ($NpmCmd) {
Write-Host "Installing npm globals: @anthropic-ai/claude-code, @openai/codex"
npm install -g @anthropic-ai/claude-code
npm install -g @openai/codex
} else {
Write-Warning "npm not found in refreshed PATH. Open a new terminal and run:"
Write-Warning " npm install -g @anthropic-ai/claude-code @openai/codex"
}
}
Write-Host "Installing: VS Code (with shell context menu + file associations)"
winget install --id Microsoft.VisualStudioCode --accept-package-agreements --accept-source-agreements --silent `
--override "/VERYSILENT /SP- /MERGETASKS=`"addcontextmenufiles,addcontextmenufolders,associatewithfiles,addtopath`""
# 6. WSL Provisioning (Dev Only)
if ($InstallDevTools) {
Write-Host "Provisioning WSL..."
if (Get-Command wsl -ErrorAction SilentlyContinue) {
wsl --update | Out-Null
} else {
Write-Warning "WSL not found. Enabling VirtualMachinePlatform — a REBOOT is required before WSL can be installed."
Write-Warning "After rebooting, run: wsl --install --distribution Ubuntu"
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart | Out-Null
}
}
Write-Host "Provisioning complete. Reboot to apply all PATH changes." -ForegroundColor Green