diff --git a/docker.ps1 b/docker.ps1 index e70046b..46a68be 100644 --- a/docker.ps1 +++ b/docker.ps1 @@ -56,6 +56,13 @@ param( $ErrorActionPreference = 'Stop' $Root = $PSScriptRoot +# Refresh PATH from the registry so `docker` resolves even in a terminal opened +# before Docker Desktop was installed (a common first-run gotcha). +$env:Path = (@( + [Environment]::GetEnvironmentVariable('Path', 'Machine'), + [Environment]::GetEnvironmentVariable('Path', 'User') + ) | Where-Object { $_ }) -join ';' + function Write-Step($m) { Write-Host "==> $m" -ForegroundColor Cyan } function Write-Ok($m) { Write-Host " + $m" -ForegroundColor Green } function Write-Warn2($m){ Write-Host " ! $m" -ForegroundColor Yellow }