From: misomosi Date: Thu, 3 Sep 2026 15:23:53 +0000 (-0400) Subject: Improve comments and use 'ls' for stalling instead X-Git-Url: http://git.misomosispi.com/?a=commitdiff_plain;h=7efa23e50f64881793033aa7bb725259d6d38257;p=gists.git Improve comments and use 'ls' for stalling instead --- diff --git a/Win11HomeScripts/DockerDesktopHome.ps1 b/Win11HomeScripts/DockerDesktopHome.ps1 index d2a3bd0..6ddb559 100644 --- a/Win11HomeScripts/DockerDesktopHome.ps1 +++ b/Win11HomeScripts/DockerDesktopHome.ps1 @@ -1,7 +1,7 @@ -# 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' @@ -16,9 +16,11 @@ try { $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 {