-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathenable-docker.ps1
More file actions
23 lines (18 loc) · 1.06 KB
/
enable-docker.ps1
File metadata and controls
23 lines (18 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# Script to enable Windows components required for Docker Desktop
Write-Host "Checking and enabling Windows components for Docker..." -ForegroundColor Cyan
# Enable Hyper-V (if available)
Write-Host "`nEnabling Hyper-V..." -ForegroundColor Yellow
try {
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All -NoRestart -ErrorAction SilentlyContinue
} catch {
Write-Host "Hyper-V is not available or already enabled" -ForegroundColor Gray
}
# Enable Virtual Machine Platform
Write-Host "Enabling Virtual Machine Platform..." -ForegroundColor Yellow
Enable-WindowsOptionalFeature -Online -FeatureName VirtualMachinePlatform -NoRestart
# Enable Windows Subsystem for Linux
Write-Host "Enabling WSL..." -ForegroundColor Yellow
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux -NoRestart
Write-Host "`nDone! Please restart your computer to apply changes." -ForegroundColor Green
Write-Host "After restart, install WSL2 if not already installed:" -ForegroundColor Yellow
Write-Host " wsl --install" -ForegroundColor White