diff --git a/src/vs/base/node/ps.ts b/src/vs/base/node/ps.ts index 5f161533b5bd16a3db8d7678b844742c05ef90ec..ba5b81d31902d5f2858652aeabc001bdd80ac931 100644 --- a/src/vs/base/node/ps.ts +++ b/src/vs/base/node/ps.ts @@ -140,10 +140,10 @@ export function listProcesses(rootPid: number): Promise { } }; - const execMain = path.basename(process.execPath).replace(/ /g, '` '); - const script = URI.parse(require.toUrl('vs/base/node/ps-win.ps1')).fsPath.replace(/ /g, '` '); - const commandLine = `${script} -ProcessName ${execMain} -MaxSamples 3`; - const cmd = spawn('powershell.exe', ['-ExecutionPolicy', 'Bypass', '-Command', commandLine]); + const execMain = path.basename(process.execPath); + const script = URI.parse(require.toUrl('vs/base/node/ps-win.ps1')).fsPath; + const commandLine = `& {& '${script}' -ProcessName '${execMain}' -MaxSamples 3}`; + const cmd = spawn('powershell.exe', ['-NoProfile', '-ExecutionPolicy', 'Bypass', '-Command', commandLine]); let stdout = ''; let stderr = '';