This commit is contained in:
2026-10-21 15:10:44 +08:00
parent 40a03978cd
commit 6fe632f28e
34 changed files with 372 additions and 110 deletions
@@ -59,7 +59,8 @@ try {
} catch { $failed = $true }
[ordered]@{failed=$failed; calls=$global:calls; published=$global:published} | ConvertTo-Json -Compress
`
const result = spawnSync(process.platform === 'win32' ? 'powershell.exe' : 'pwsh',
// 使用项目统一的 PowerShell 7,避免子进程回落 Windows PowerShell 5 的模块路径与解析环境。
const result = spawnSync('pwsh',
['-NoProfile', '-NonInteractive', '-EncodedCommand', Buffer.from(command, 'utf16le').toString('base64')],
{ encoding: 'utf8', timeout: 30_000 })
assert.equal(result.status, 0, result.stderr || result.error?.message)