diff --git a/lib/PowerShell/Utilities/PowerShellToolRunner.js b/lib/PowerShell/Utilities/PowerShellToolRunner.js index 2bee28fd..887da464 100644 --- a/lib/PowerShell/Utilities/PowerShellToolRunner.js +++ b/lib/PowerShell/Utilities/PowerShellToolRunner.js @@ -28,7 +28,7 @@ class PowerShellToolRunner { } static executePowerShellScriptBlock(scriptBlock, options = {}) { return __awaiter(this, void 0, void 0, function* () { - yield exec.exec(`${PowerShellToolRunner.psPath} -Command`, [scriptBlock], options); + yield exec.exec(`"${PowerShellToolRunner.psPath}" -Command`, [scriptBlock], options); }); } } diff --git a/src/PowerShell/Utilities/PowerShellToolRunner.ts b/src/PowerShell/Utilities/PowerShellToolRunner.ts index dd08b2a2..e8364f32 100644 --- a/src/PowerShell/Utilities/PowerShellToolRunner.ts +++ b/src/PowerShell/Utilities/PowerShellToolRunner.ts @@ -11,6 +11,6 @@ export default class PowerShellToolRunner { } static async executePowerShellScriptBlock(scriptBlock: string, options: any = {}) { - await exec.exec(`${PowerShellToolRunner.psPath} -Command`, [scriptBlock], options) + await exec.exec(`"${PowerShellToolRunner.psPath}" -Command`, [scriptBlock], options) } } \ No newline at end of file