Merge pull request #236514 from microsoft/tyriar/219583

Speculative fix when pwsh is 'powershell' on mac/linux
pull/236441/head
Daniel Imms 2024-12-18 12:07:26 -08:00 committed by GitHub
commit ebe010b7aa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -129,7 +129,7 @@ async function doResolveUnixShellEnv(logService: ILogService, token: Cancellatio
const name = basename(systemShellUnix);
let command: string, shellArgs: Array<string>;
const extraArgs = '';
if (/^pwsh(-preview)?$/.test(name)) {
if (/^(?:pwsh(?:-preview)|powershell)$/.test(name)) {
// Older versions of PowerShell removes double quotes sometimes so we use "double single quotes" which is how
// you escape single quotes inside of a single quoted string.
command = `& '${process.execPath}' ${extraArgs} -p '''${mark}'' + JSON.stringify(process.env) + ''${mark}'''`;