From 0759f77bb8d86658bc935a10a64f6182c5a1eeba Mon Sep 17 00:00:00 2001 From: Dirk Baeumer Date: Fri, 15 Dec 2017 10:35:31 +0100 Subject: [PATCH] Fixes #40228: code --status doesn't work if your shell is PowerShell --- src/vs/base/node/ps.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/vs/base/node/ps.ts b/src/vs/base/node/ps.ts index 5f161533b5b..ba5b81d3190 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 = ''; -- GitLab