最後活躍 1777531034

修訂 b064ae1f822b10fe95c397d00ca12023ee2d200f

install-virt-wsl-and-podman-desktop.ps1 原始檔案
1if (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
2 Write-Host "CRITICAL ERROR: Please run this PowerShell window as Administrator." -ForegroundColor Red
3 exit
4}
5
6winget install Microsoft.PowerShell --silent --accept-package-agreements --accept-source-agreements
7
8Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
9
10
11Write-Host "--- Starting Technician Environment Setup ---" -ForegroundColor Cyan
12
13Write-Host "[1/5] Enabling Hyper-V and Virtualization Features..." -ForegroundColor Yellow
14$features = @(
15 "Microsoft-Hyper-V",
16 "Microsoft-Hyper-V-Management-Clients",
17 "Microsoft-Hyper-V-All",
18 "Microsoft-Windows-Subsystem-Linux",
19 "VirtualMachinePlatform"
20)
21
22foreach ($feature in $features) {
23 Write-Host "Installing: $feature"
24 dism.exe /online /enable-feature /featurename:$feature /all /norestart
25}
26
27wsl --update
28
29wsl --set-default-version 2
30
31wsl --update
32
33winget install RedHat.Podman --silent --accept-package-agreements --accept-source-agreements
34
35choco install podman-desktop -y