]> localhost Git - gists.git/commitdiff
Improve comments and use 'ls' for stalling instead
authormisomosi <[email protected]>
Thu, 3 Sep 2026 15:23:53 +0000 (11:23 -0400)
committermisomosi <[email protected]>
Thu, 3 Sep 2026 15:23:53 +0000 (11:23 -0400)
Win11HomeScripts/DockerDesktopHome.ps1

index d2a3bd055a2079de6ab61f9948ed6342858544d4..6ddb559bf812549ca276e3d5f315a2595baa5970 100644 (file)
@@ -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 {