Skip to content

Commit 6dc1b45

Browse files
Merge master into feature/serverlessland
2 parents d4e45a4 + 191c504 commit 6dc1b45

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

packages/core/src/shared/utilities/processUtils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ export class ChildProcess {
367367
if (typeof rejectOnErrorCode === 'function') {
368368
reject(rejectOnErrorCode(code))
369369
} else {
370-
reject(new Error(`Command exited with non-zero code: ${code}`))
370+
reject(new Error(`Command exited with non-zero code (${code}): ${this.toString()}`))
371371
}
372372
}
373373
if (options.waitForStreams === false) {

packages/core/src/test/shared/extensions/ssh.test.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,22 @@ import { isWin } from '../../../shared/vscode/env'
1515

1616
describe('SSH Agent', function () {
1717
it('can start the agent on windows', async function () {
18+
this.retries(2)
19+
1820
// TODO: we should also skip this test if not running in CI
1921
// Local machines probably won't have admin permissions in the spawned processes
2022
if (process.platform !== 'win32') {
2123
this.skip()
2224
}
2325

24-
const runCommand = (command: string) => {
25-
const args = ['-Command', command]
26-
return new ChildProcess('powershell.exe', args).run({ rejectOnErrorCode: true })
26+
async function runCommand(command: string) {
27+
const args = ['-NoLogo', '-NonInteractive', '-ExecutionPolicy', 'RemoteSigned', '-Command', command]
28+
return await new ChildProcess('pwsh.exe', args).run({ rejectOnErrorCode: true })
2729
}
2830

29-
const getStatus = () => {
30-
return runCommand('echo (Get-Service ssh-agent).Status').then((o) => o.stdout)
31+
async function getStatus() {
32+
const c = await runCommand('echo (Get-Service ssh-agent).Status')
33+
return c.stdout
3134
}
3235

3336
await runCommand('Stop-Service ssh-agent')

0 commit comments

Comments
 (0)