优化
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user