diff --git a/auto-setup.ps1 b/auto-setup.ps1 index 0b3acab..20f35ff 100644 --- a/auto-setup.ps1 +++ b/auto-setup.ps1 @@ -237,6 +237,11 @@ function Run-CmdWithUI { [int]$timeoutMs = 180000, # 默认 3 分钟 [switch]$captureOutput # 返回 stdout 内容 ) + # W-01: Windows Start-Process 兼容 — npm/npx 无扩展名是 Unix shell 脚本 + if ($exe -in @("npm", "npx") -and -not $exe.EndsWith(".cmd")) { + $exe = "$exe.cmd" + } + # B1: 脱敏日志 (去除 URL 内嵌凭证 user:pass@) $sanitizedArgs = ($arguments -join ' ') -replace '://[^@]+@', '://***@' Bw-Log "CMD" "$exe $sanitizedArgs"