diff --git a/scripts/deploy-from-workstation.ps1 b/scripts/deploy-from-workstation.ps1 index 94fb9678..f50f6d93 100644 --- a/scripts/deploy-from-workstation.ps1 +++ b/scripts/deploy-from-workstation.ps1 @@ -326,7 +326,11 @@ try { # deploy-auth.ps1 is dot-sourced and can clear the automatic script path # variable on PowerShell Core. Restore it before invoking the build helper. $PSScriptRoot = $scriptRoot - & (Join-Path $scriptRoot 'build-frontend.ps1') + $pwshPath = (Get-Process -Id $PID).Path + if ([string]::IsNullOrWhiteSpace($pwshPath)) { + throw '无法定位当前 PowerShell 可执行文件。' + } + & $pwshPath -NoProfile -File (Join-Path $scriptRoot 'build-frontend.ps1') docker buildx inspect $BuilderName 2>$null | Out-Null if ($LASTEXITCODE -ne 0) {