Fixes #40228: code --status doesn't work if your shell is PowerShell

This commit is contained in:
Dirk Baeumer
2017-12-15 10:35:31 +01:00
parent 9622ada626
commit fa61ea9c06

View File

@@ -158,10 +158,10 @@ export function listProcesses(rootPid: number): Promise<ProcessItem> {
}
};
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 = '';