-# To run Docker Desktop on Home with the Windows engine,
-# it needs to detect that Windows is a supported edition,
-# so temporarily change EditionID to Professional and
-# restore it back afterwards
+# Containers and Hyper-V can be enabled on Windows Home via DISM,
+# but Docker Desktop checks EditionID anyways, not the actual features,
+# so temporarily masquerade the EditionID as Professional, start Docker Desktop,
+# then restore EditionID to whatever it was previously
# Must run this whole block with elevated privileges
$keyname = 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion'
$principal = New-ScheduledTaskPrincipal -UserId "$env:USERNAME" -LogonType Interactive -RunLevel Limited
$task = New-ScheduledTask -Action $action -Principal $principal
+ # Start the task and wait only until docker desktop engine is running to remove the task
+ # "docker desktop engine ls" is informative and stalls until docker desktop engine is running
Register-ScheduledTask -TaskName "TempStartDockerDesktop" -InputObject $task | Start-ScheduledTask
Write-Output "Starting Docker Desktop! Attempting to set the docker engine to windows"
- docker desktop engine use windows
+ docker desktop engine ls
Unregister-ScheduledTask -TaskName "TempStartDockerDesktop" -Confirm:$false
}
finally {