What happens
installers/windows/ods.ps1 sets $ErrorActionPreference = "Stop" globally (line ~38) and in several spots redirects native stderr:
- line ~71:
$null = docker info 2>$null (Test-DockerRunning)
- line ~1978:
& docker compose @flags ps ... 2>$null
- line ~670:
$curlOutput = & $curl.Source ... 2>&1
On PS 5.1, redirecting native stderr turns each stderr line into an ErrorRecord, which becomes terminating under Stop. Repro on 5.1.26100:
$ErrorActionPreference='Stop'
$null = cmd /c "echo boom 1>&2" 2>$null # throws RemoteException :: boom
The author clearly knows this gotcha — lines ~2633-2637 and ~3370-3373 temporarily set SilentlyContinue around native calls — but these spots were missed.
Impact
- Docker Desktop not running →
.\ods.ps1 status/start dies with a raw docker info : ... error instead of the intended friendly message + exit 1.
repair voice: a timing-out curl writes curl: (28)... via 2>&1 and throws before the deliberate -eq 28 tolerance check (~line 672), aborting repair.
PS 7 is unaffected, but scheduled tasks / double-click use powershell.exe 5.1.
Suggested fix
Wrap those call sites in local preference scopes (same as the existing pattern), e.g. push $ErrorActionPreference='SilentlyContinue' around the native invocation and restore afterwards, or route stderr through a temp file.
What happens
installers/windows/ods.ps1sets$ErrorActionPreference = "Stop"globally (line ~38) and in several spots redirects native stderr:$null = docker info 2>$null(Test-DockerRunning)& docker compose @flags ps ... 2>$null$curlOutput = & $curl.Source ... 2>&1On PS 5.1, redirecting native stderr turns each stderr line into an ErrorRecord, which becomes terminating under
Stop. Repro on 5.1.26100:The author clearly knows this gotcha — lines ~2633-2637 and ~3370-3373 temporarily set
SilentlyContinuearound native calls — but these spots were missed.Impact
.\ods.ps1 status/startdies with a rawdocker info : ...error instead of the intended friendly message + exit 1.repair voice: a timing-out curl writescurl: (28)...via2>&1and throws before the deliberate-eq 28tolerance check (~line 672), aborting repair.PS 7 is unaffected, but scheduled tasks / double-click use
powershell.exe5.1.Suggested fix
Wrap those call sites in local preference scopes (same as the existing pattern), e.g. push
$ErrorActionPreference='SilentlyContinue'around the native invocation and restore afterwards, or route stderr through a temp file.