Skip to content
This repository has been archived by the owner on Apr 22, 2022. It is now read-only.

Commit

Permalink
changes in PowerShellToolRunner (Azure#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
aksm-ms authored May 13, 2020
1 parent 4152625 commit 68df1fd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/Utilities/PowerShellToolRunner.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ class PowerShellToolRunner {
}
static executePowerShellCommand(command, options = {}) {
return __awaiter(this, void 0, void 0, function* () {
yield exec.exec(`${PowerShellToolRunner.psPath} -NoLogo -NoProfile -NonInteractive -Command ${command}`, [], options);
yield exec.exec(`"${PowerShellToolRunner.psPath}" -NoLogo -NoProfile -NonInteractive -Command ${command}`, [], options);
});
}
static executePowerShellScriptBlock(scriptBlock, options = {}) {
return __awaiter(this, void 0, void 0, function* () {
const exitCode = yield exec.exec(`${PowerShellToolRunner.psPath} -NoLogo -NoProfile -NonInteractive -Command`, [scriptBlock], options);
const exitCode = yield exec.exec(`"${PowerShellToolRunner.psPath}" -NoLogo -NoProfile -NonInteractive -Command`, [scriptBlock], options);
return exitCode;
});
}
Expand Down
4 changes: 2 additions & 2 deletions src/Utilities/PowerShellToolRunner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ export default class PowerShellToolRunner {
}

static async executePowerShellCommand(command: string, options: any = {}) {
await exec.exec(`${PowerShellToolRunner.psPath} -NoLogo -NoProfile -NonInteractive -Command ${command}`, [], options);
await exec.exec(`"${PowerShellToolRunner.psPath}" -NoLogo -NoProfile -NonInteractive -Command ${command}`, [], options);
}

static async executePowerShellScriptBlock(scriptBlock: string, options: any = {}): Promise<number> {
const exitCode: number = await exec.exec(`${PowerShellToolRunner.psPath} -NoLogo -NoProfile -NonInteractive -Command`,
const exitCode: number = await exec.exec(`"${PowerShellToolRunner.psPath}" -NoLogo -NoProfile -NonInteractive -Command`,
[scriptBlock], options);
return exitCode;
}
Expand Down

0 comments on commit 68df1fd

Please sign in to comment.