Skip to content

Commit fa61ea9

Browse files
committed
Fixes microsoft#40228: code --status doesn't work if your shell is PowerShell
1 parent 9622ada commit fa61ea9

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/vs/base/node/ps.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -158,10 +158,10 @@ export function listProcesses(rootPid: number): Promise<ProcessItem> {
158158
}
159159
};
160160

161-
const execMain = path.basename(process.execPath).replace(/ /g, '` ');
162-
const script = URI.parse(require.toUrl('vs/base/node/ps-win.ps1')).fsPath.replace(/ /g, '` ');
163-
const commandLine = `${script} -ProcessName ${execMain} -MaxSamples 3`;
164-
const cmd = spawn('powershell.exe', ['-ExecutionPolicy', 'Bypass', '-Command', commandLine]);
161+
const execMain = path.basename(process.execPath);
162+
const script = URI.parse(require.toUrl('vs/base/node/ps-win.ps1')).fsPath;
163+
const commandLine = `& {& '${script}' -ProcessName '${execMain}' -MaxSamples 3}`;
164+
const cmd = spawn('powershell.exe', ['-NoProfile', '-ExecutionPolicy', 'Bypass', '-Command', commandLine]);
165165

166166
let stdout = '';
167167
let stderr = '';

0 commit comments

Comments
 (0)