From 93b9e2091182e509fd51c99edf6a46eeb79a9ed3 Mon Sep 17 00:00:00 2001 From: Sydney Smith <43417619+SydneyhSmith@users.noreply.github.com> Date: Thu, 18 Jul 2019 09:28:30 -0700 Subject: [PATCH 01/42] Update platform.ts Checks for PowerShell Core on Windows OS, if exists uses the latest version of PowerShell as the default PowerShell path --- src/platform.ts | 42 ++++++++++++++++++++++++++++++++---------- 1 file changed, 32 insertions(+), 10 deletions(-) diff --git a/src/platform.ts b/src/platform.ts index eb6146fb9a..e94cb31f46 100644 --- a/src/platform.ts +++ b/src/platform.ts @@ -69,17 +69,39 @@ export function getDefaultPowerShellPath( // Find the path to powershell.exe based on the current platform // and the user's desire to run the x86 version of PowerShell - if (platformDetails.operatingSystem === OperatingSystem.Windows) { - if (use32Bit) { - powerShellExePath = - platformDetails.isOS64Bit && platformDetails.isProcess64Bit - ? SysWow64PowerShellPath - : System32PowerShellPath; + if (platformDetails.operatingSystem === OperatingSystem.Windows) { + const psCoreInstallPath = + (!platformDetails.isProcess64Bit ? process.env.ProgramW6432 : process.env.ProgramFiles) + "\\PowerShell"; + if (fs.existsSync(psCoreInstallPath)) { + const arch = platformDetails.isProcess64Bit ? "(x64)" : "(x86)"; + const psCorePaths = + fs.readdirSync(psCoreInstallPath) + .map((item) => path.join(psCoreInstallPath, item)) + .filter((item) => { + const exePath = path.join(item, "pwsh.exe"); + return fs.lstatSync(item).isDirectory() && fs.existsSync(exePath); + }) + .map((item) => ({ + versionName: `PowerShell Core ${path.parse(item).base} ${arch}`, + exePath: path.join(item, "pwsh.exe"), + })); + + if (psCorePaths) { + powerShellExePath = psCorePaths[0].exePath; + } + } else { - powerShellExePath = - !platformDetails.isOS64Bit || platformDetails.isProcess64Bit - ? System32PowerShellPath - : SysnativePowerShellPath; + if (use32Bit) { + powerShellExePath = + platformDetails.isOS64Bit && platformDetails.isProcess64Bit + ? SysWow64PowerShellPath + : System32PowerShellPath; + } else { + powerShellExePath = + !platformDetails.isOS64Bit || platformDetails.isProcess64Bit + ? System32PowerShellPath + : SysnativePowerShellPath; + } } } else if (platformDetails.operatingSystem === OperatingSystem.MacOS) { // Always default to the stable version of PowerShell (if installed) but handle case of only Preview installed From f5e99d44c087430aec58f54fb54a994e6979a50a Mon Sep 17 00:00:00 2001 From: Sydney Smith <43417619+SydneyhSmith@users.noreply.github.com> Date: Thu, 18 Jul 2019 09:40:12 -0700 Subject: [PATCH 02/42] Update session.ts Removes SSL check --- src/session.ts | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/src/session.ts b/src/session.ts index c110b79577..a5eb85ace0 100644 --- a/src/session.ts +++ b/src/session.ts @@ -113,34 +113,6 @@ export class SessionManager implements Middleware { this.powerShellExePath = this.getPowerShellExePath(); - // Check for OpenSSL dependency on macOS when running PowerShell Core alpha. Look for the default - // Homebrew installation path and if that fails check the system-wide library path. - if (os.platform() === "darwin" && this.getPowerShellVersionLabel() === "alpha") { - if (!(utils.checkIfFileExists("/usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib") && - utils.checkIfFileExists("/usr/local/opt/openssl/lib/libssl.1.0.0.dylib")) && - !(utils.checkIfFileExists("/usr/local/lib/libcrypto.1.0.0.dylib") && - utils.checkIfFileExists("/usr/local/lib/libssl.1.0.0.dylib"))) { - const thenable = - vscode.window.showWarningMessage( - "The PowerShell extension will not work without OpenSSL on macOS and OS X when using " + - "PowerShell Core alpha", - "Show Documentation"); - - thenable.then( - (s) => { - if (s === "Show Documentation") { - cp.exec("open https://github.com/PowerShell/vscode-powershell/blob/master/docs/" + - "troubleshooting.md#1-powershell-intellisense-does-not-work-cant-debug-scripts"); - } - }); - - // Don't continue initializing since Editor Services will not load successfully - this.setSessionFailure( - "Cannot start PowerShell Editor Services due to missing OpenSSL dependency."); - return; - } - } - this.suppressRestartPrompt = false; if (this.powerShellExePath) { From 8e829bd0aefeab43c41f961d3c28387a3994c727 Mon Sep 17 00:00:00 2001 From: Sydney Smith <43417619+SydneyhSmith@users.noreply.github.com> Date: Thu, 18 Jul 2019 09:54:33 -0700 Subject: [PATCH 03/42] Update platform.ts --- src/platform.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/platform.ts b/src/platform.ts index e94cb31f46..d8ec5d5bf3 100644 --- a/src/platform.ts +++ b/src/platform.ts @@ -69,7 +69,7 @@ export function getDefaultPowerShellPath( // Find the path to powershell.exe based on the current platform // and the user's desire to run the x86 version of PowerShell - if (platformDetails.operatingSystem === OperatingSystem.Windows) { + if (platformDetails.operatingSystem === OperatingSystem.Windows) { const psCoreInstallPath = (!platformDetails.isProcess64Bit ? process.env.ProgramW6432 : process.env.ProgramFiles) + "\\PowerShell"; if (fs.existsSync(psCoreInstallPath)) { From be41e5b4c0d74d0d656532b0617a1b24a552f372 Mon Sep 17 00:00:00 2001 From: Sydney Smith <43417619+SydneyhSmith@users.noreply.github.com> Date: Fri, 19 Jul 2019 09:38:33 -0700 Subject: [PATCH 04/42] Update src/platform.ts Co-Authored-By: Tyler James Leonhardt --- src/platform.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/platform.ts b/src/platform.ts index d8ec5d5bf3..83a502c2d6 100644 --- a/src/platform.ts +++ b/src/platform.ts @@ -71,7 +71,7 @@ export function getDefaultPowerShellPath( // and the user's desire to run the x86 version of PowerShell if (platformDetails.operatingSystem === OperatingSystem.Windows) { const psCoreInstallPath = - (!platformDetails.isProcess64Bit ? process.env.ProgramW6432 : process.env.ProgramFiles) + "\\PowerShell"; + (platformDetails.isProcess64Bit ? process.env.ProgramFiles : process.env.ProgramW6432) + "\\PowerShell"; if (fs.existsSync(psCoreInstallPath)) { const arch = platformDetails.isProcess64Bit ? "(x64)" : "(x86)"; const psCorePaths = From 962bac76e35062930102ff5fc2dcb13afaecec84 Mon Sep 17 00:00:00 2001 From: Sydney Smith <43417619+SydneyhSmith@users.noreply.github.com> Date: Fri, 19 Jul 2019 13:57:45 -0700 Subject: [PATCH 05/42] Update platform.ts --- src/platform.ts | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/platform.ts b/src/platform.ts index 83a502c2d6..66ab8ee638 100644 --- a/src/platform.ts +++ b/src/platform.ts @@ -66,12 +66,18 @@ export function getDefaultPowerShellPath( use32Bit: boolean = false): string | null { let powerShellExePath; + let psCoreInstallPath; // Find the path to powershell.exe based on the current platform // and the user's desire to run the x86 version of PowerShell if (platformDetails.operatingSystem === OperatingSystem.Windows) { - const psCoreInstallPath = - (platformDetails.isProcess64Bit ? process.env.ProgramFiles : process.env.ProgramW6432) + "\\PowerShell"; + if (use32Bit) { + psCoreInstallPath = + (platformDetails.isProcess64Bit ? process.env.ProgramW6432 : process.env.ProgramFiles) + "\\PowerShell"; + } else { + + psCoreInstallPath = psCoreInstallPath = process.env.ProgramFiles + "\\PowerShell"; + } if (fs.existsSync(psCoreInstallPath)) { const arch = platformDetails.isProcess64Bit ? "(x64)" : "(x86)"; const psCorePaths = @@ -87,22 +93,20 @@ export function getDefaultPowerShellPath( })); if (psCorePaths) { - powerShellExePath = psCorePaths[0].exePath; + return powerShellExePath = psCorePaths[0].exePath; } - - } else { - if (use32Bit) { + } + if (use32Bit) { powerShellExePath = platformDetails.isOS64Bit && platformDetails.isProcess64Bit ? SysWow64PowerShellPath : System32PowerShellPath; - } else { + } else { powerShellExePath = !platformDetails.isOS64Bit || platformDetails.isProcess64Bit ? System32PowerShellPath : SysnativePowerShellPath; } - } } else if (platformDetails.operatingSystem === OperatingSystem.MacOS) { // Always default to the stable version of PowerShell (if installed) but handle case of only Preview installed powerShellExePath = macOSExePath; From decb0ac69bf293cff603bc902157804074fb7586 Mon Sep 17 00:00:00 2001 From: Sydney Smith <43417619+SydneyhSmith@users.noreply.github.com> Date: Fri, 19 Jul 2019 14:08:48 -0700 Subject: [PATCH 06/42] Update platform.test.ts --- test/platform.test.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/platform.test.ts b/test/platform.test.ts index 93de86ea61..73cc16e246 100644 --- a/test/platform.test.ts +++ b/test/platform.test.ts @@ -46,7 +46,7 @@ suite("Platform module", () => { checkDefaultPowerShellPath( platformDetails, - platform.System32PowerShellPath); + platform.getAvailablePowerShellExes(platformDetails, undefined)[0]); checkAvailableWindowsPowerShellPaths( platformDetails, @@ -76,7 +76,7 @@ suite("Platform module", () => { checkDefaultPowerShellPath( platformDetails, - platform.SysnativePowerShellPath); + platform.getAvailablePowerShellExes(platformDetails, undefined)[0]); checkAvailableWindowsPowerShellPaths( platformDetails, @@ -106,7 +106,7 @@ suite("Platform module", () => { checkDefaultPowerShellPath( platformDetails, - platform.System32PowerShellPath); + platform.getAvailablePowerShellExes(platformDetails, undefined)[0]); checkAvailableWindowsPowerShellPaths( platformDetails, From 29cde1b0ca5d87c2895d4c585a57a6cac224ff9d Mon Sep 17 00:00:00 2001 From: Sydney Smith <43417619+SydneyhSmith@users.noreply.github.com> Date: Fri, 19 Jul 2019 14:28:37 -0700 Subject: [PATCH 07/42] Update platform.test.ts --- test/platform.test.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/platform.test.ts b/test/platform.test.ts index 73cc16e246..8fd03dec3b 100644 --- a/test/platform.test.ts +++ b/test/platform.test.ts @@ -46,7 +46,7 @@ suite("Platform module", () => { checkDefaultPowerShellPath( platformDetails, - platform.getAvailablePowerShellExes(platformDetails, undefined)[0]); + platform.getAvailablePowerShellExes(platformDetails, undefined)[0].exePath); checkAvailableWindowsPowerShellPaths( platformDetails, @@ -76,7 +76,7 @@ suite("Platform module", () => { checkDefaultPowerShellPath( platformDetails, - platform.getAvailablePowerShellExes(platformDetails, undefined)[0]); + platform.getAvailablePowerShellExes(platformDetails, undefined)[0].exePath); checkAvailableWindowsPowerShellPaths( platformDetails, @@ -106,7 +106,7 @@ suite("Platform module", () => { checkDefaultPowerShellPath( platformDetails, - platform.getAvailablePowerShellExes(platformDetails, undefined)[0]); + platform.getAvailablePowerShellExes(platformDetails, undefined)[0].exePath); checkAvailableWindowsPowerShellPaths( platformDetails, From df67d6be30f51a1900a7fcaadd82ff6e36f7420a Mon Sep 17 00:00:00 2001 From: Sydney Smith <43417619+SydneyhSmith@users.noreply.github.com> Date: Mon, 22 Jul 2019 10:46:16 -0700 Subject: [PATCH 08/42] Update platform.ts --- src/platform.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/platform.ts b/src/platform.ts index 66ab8ee638..c4440b0ced 100644 --- a/src/platform.ts +++ b/src/platform.ts @@ -73,10 +73,12 @@ export function getDefaultPowerShellPath( if (platformDetails.operatingSystem === OperatingSystem.Windows) { if (use32Bit) { psCoreInstallPath = - (platformDetails.isProcess64Bit ? process.env.ProgramW6432 : process.env.ProgramFiles) + "\\PowerShell"; + (platformDetails.isProcess64Bit ? process.env['ProgramFiles(x86)'] : process.env.ProgramFiles) + + "\\PowerShell"; } else { - psCoreInstallPath = psCoreInstallPath = process.env.ProgramFiles + "\\PowerShell"; + psCoreInstallPath = + (platformDetails.isProcess64Bit ? process.env.ProgramFiles : process.env.ProgramW6432) + "\\PowerShell"; } if (fs.existsSync(psCoreInstallPath)) { const arch = platformDetails.isProcess64Bit ? "(x64)" : "(x86)"; From 2ddc9c02ff6e98e8f64cc7277a95f47c9b574561 Mon Sep 17 00:00:00 2001 From: Sydney Smith <43417619+SydneyhSmith@users.noreply.github.com> Date: Mon, 22 Jul 2019 14:23:49 -0700 Subject: [PATCH 09/42] Update platform.ts --- src/platform.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/platform.ts b/src/platform.ts index c4440b0ced..5cd9a10711 100644 --- a/src/platform.ts +++ b/src/platform.ts @@ -73,7 +73,7 @@ export function getDefaultPowerShellPath( if (platformDetails.operatingSystem === OperatingSystem.Windows) { if (use32Bit) { psCoreInstallPath = - (platformDetails.isProcess64Bit ? process.env['ProgramFiles(x86)'] : process.env.ProgramFiles) + (platformDetails.isProcess64Bit ? process.env["ProgramFiles(x86)"] : process.env.ProgramFiles) + "\\PowerShell"; } else { From a373034ab7a13f69104503335cea6744e070a7ef Mon Sep 17 00:00:00 2001 From: Sydney Smith <43417619+SydneyhSmith@users.noreply.github.com> Date: Fri, 26 Jul 2019 14:09:37 -0700 Subject: [PATCH 10/42] Update platform.test.ts --- test/platform.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/platform.test.ts b/test/platform.test.ts index 8fd03dec3b..41fabb20fd 100644 --- a/test/platform.test.ts +++ b/test/platform.test.ts @@ -106,7 +106,7 @@ suite("Platform module", () => { checkDefaultPowerShellPath( platformDetails, - platform.getAvailablePowerShellExes(platformDetails, undefined)[0].exePath); + platform.getAvailablePowerShellExes(platformDetails, undefined)[1].exePath); checkAvailableWindowsPowerShellPaths( platformDetails, From a7931aee8028d88137c4324e82a88de59c9eac18 Mon Sep 17 00:00:00 2001 From: Sydney Smith <43417619+SydneyhSmith@users.noreply.github.com> Date: Fri, 26 Jul 2019 14:18:10 -0700 Subject: [PATCH 11/42] Update platform.test.ts --- test/platform.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/platform.test.ts b/test/platform.test.ts index 41fabb20fd..cece56ef0a 100644 --- a/test/platform.test.ts +++ b/test/platform.test.ts @@ -76,7 +76,7 @@ suite("Platform module", () => { checkDefaultPowerShellPath( platformDetails, - platform.getAvailablePowerShellExes(platformDetails, undefined)[0].exePath); + platform.getAvailablePowerShellExes(platformDetails, undefined)[1].exePath); checkAvailableWindowsPowerShellPaths( platformDetails, From 38a9cf710b6dac2c814b6ac9ec4191fd198fc7b8 Mon Sep 17 00:00:00 2001 From: Sydney Smith <43417619+SydneyhSmith@users.noreply.github.com> Date: Fri, 26 Jul 2019 14:26:24 -0700 Subject: [PATCH 12/42] Update platform.test.ts --- test/platform.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/platform.test.ts b/test/platform.test.ts index cece56ef0a..6b27b750b3 100644 --- a/test/platform.test.ts +++ b/test/platform.test.ts @@ -76,7 +76,7 @@ suite("Platform module", () => { checkDefaultPowerShellPath( platformDetails, - platform.getAvailablePowerShellExes(platformDetails, undefined)[1].exePath); + platform.getAvailablePowerShellExes(platformDetails, undefined)[2].exePath); checkAvailableWindowsPowerShellPaths( platformDetails, From 9981f80e24197bdc91cdab0aac5446cf7d35e200 Mon Sep 17 00:00:00 2001 From: Sydney Smith <43417619+SydneyhSmith@users.noreply.github.com> Date: Mon, 29 Jul 2019 09:47:43 -0700 Subject: [PATCH 13/42] Update src/platform.ts Co-Authored-By: Christoph Bergmeister [MVP] --- src/platform.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/platform.ts b/src/platform.ts index 5cd9a10711..bbc2416f73 100644 --- a/src/platform.ts +++ b/src/platform.ts @@ -68,7 +68,7 @@ export function getDefaultPowerShellPath( let powerShellExePath; let psCoreInstallPath; - // Find the path to powershell.exe based on the current platform + // Find the path to the powershell executable based on the current platform // and the user's desire to run the x86 version of PowerShell if (platformDetails.operatingSystem === OperatingSystem.Windows) { if (use32Bit) { From aea0c5dee23369575082c939429ad0932cbb13bb Mon Sep 17 00:00:00 2001 From: Sydney Smith <43417619+SydneyhSmith@users.noreply.github.com> Date: Mon, 29 Jul 2019 12:56:50 -0700 Subject: [PATCH 14/42] Update platform.ts --- src/platform.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/platform.ts b/src/platform.ts index bbc2416f73..0c6beef533 100644 --- a/src/platform.ts +++ b/src/platform.ts @@ -73,12 +73,12 @@ export function getDefaultPowerShellPath( if (platformDetails.operatingSystem === OperatingSystem.Windows) { if (use32Bit) { psCoreInstallPath = - (platformDetails.isProcess64Bit ? process.env["ProgramFiles(x86)"] : process.env.ProgramFiles) + (platformDetails.isProcess64Bit ? process.env["ProgramFiles(x86)"] : process.env.ProgramFiles) + "\\PowerShell"; } else { psCoreInstallPath = - (platformDetails.isProcess64Bit ? process.env.ProgramFiles : process.env.ProgramW6432) + "\\PowerShell"; + (platformDetails.isProcess64Bit ? process.env.ProgramFiles : process.env.ProgramW6432) + "\\PowerShell"; } if (fs.existsSync(psCoreInstallPath)) { const arch = platformDetails.isProcess64Bit ? "(x64)" : "(x86)"; From eb0639223801260f76cc45d3635dfb6e6e39cd5b Mon Sep 17 00:00:00 2001 From: Sydney Smith <43417619+SydneyhSmith@users.noreply.github.com> Date: Mon, 29 Jul 2019 12:58:03 -0700 Subject: [PATCH 15/42] Update platform.ts --- src/platform.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/platform.ts b/src/platform.ts index 0c6beef533..ee73aaec40 100644 --- a/src/platform.ts +++ b/src/platform.ts @@ -76,10 +76,10 @@ export function getDefaultPowerShellPath( (platformDetails.isProcess64Bit ? process.env["ProgramFiles(x86)"] : process.env.ProgramFiles) + "\\PowerShell"; } else { - psCoreInstallPath = (platformDetails.isProcess64Bit ? process.env.ProgramFiles : process.env.ProgramW6432) + "\\PowerShell"; } + if (fs.existsSync(psCoreInstallPath)) { const arch = platformDetails.isProcess64Bit ? "(x64)" : "(x86)"; const psCorePaths = @@ -98,6 +98,7 @@ export function getDefaultPowerShellPath( return powerShellExePath = psCorePaths[0].exePath; } } + if (use32Bit) { powerShellExePath = platformDetails.isOS64Bit && platformDetails.isProcess64Bit From faee4a790bd3d366b3237e6c533c1d4255e63a9c Mon Sep 17 00:00:00 2001 From: Sydney Smith <43417619+SydneyhSmith@users.noreply.github.com> Date: Mon, 29 Jul 2019 13:02:32 -0700 Subject: [PATCH 16/42] Update platform.ts --- src/platform.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/platform.ts b/src/platform.ts index ee73aaec40..db31369d1c 100644 --- a/src/platform.ts +++ b/src/platform.ts @@ -109,7 +109,7 @@ export function getDefaultPowerShellPath( !platformDetails.isOS64Bit || platformDetails.isProcess64Bit ? System32PowerShellPath : SysnativePowerShellPath; - } + } } else if (platformDetails.operatingSystem === OperatingSystem.MacOS) { // Always default to the stable version of PowerShell (if installed) but handle case of only Preview installed powerShellExePath = macOSExePath; From 01657f9060a17781af4704be764991cb2c0511ee Mon Sep 17 00:00:00 2001 From: Sydney Smith <43417619+SydneyhSmith@users.noreply.github.com> Date: Mon, 29 Jul 2019 13:27:36 -0700 Subject: [PATCH 17/42] Update platform.test.ts --- test/platform.test.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/platform.test.ts b/test/platform.test.ts index 6b27b750b3..aeddcf4ca4 100644 --- a/test/platform.test.ts +++ b/test/platform.test.ts @@ -46,7 +46,7 @@ suite("Platform module", () => { checkDefaultPowerShellPath( platformDetails, - platform.getAvailablePowerShellExes(platformDetails, undefined)[0].exePath); + platform.getAvailablePowerShellExes(platformDetails, undefined)[0].versionName); checkAvailableWindowsPowerShellPaths( platformDetails, @@ -76,7 +76,7 @@ suite("Platform module", () => { checkDefaultPowerShellPath( platformDetails, - platform.getAvailablePowerShellExes(platformDetails, undefined)[2].exePath); + platform.getAvailablePowerShellExes(platformDetails, undefined)[2].versionName); checkAvailableWindowsPowerShellPaths( platformDetails, @@ -106,7 +106,7 @@ suite("Platform module", () => { checkDefaultPowerShellPath( platformDetails, - platform.getAvailablePowerShellExes(platformDetails, undefined)[1].exePath); + platform.getAvailablePowerShellExes(platformDetails, undefined)[1].versionName); checkAvailableWindowsPowerShellPaths( platformDetails, From bd55ee20326e5f9493db0cab99fe5ace215a8dfb Mon Sep 17 00:00:00 2001 From: Sydney Smith <43417619+SydneyhSmith@users.noreply.github.com> Date: Mon, 29 Jul 2019 13:31:26 -0700 Subject: [PATCH 18/42] Update platform.ts --- src/platform.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/platform.ts b/src/platform.ts index db31369d1c..08fff786e3 100644 --- a/src/platform.ts +++ b/src/platform.ts @@ -98,7 +98,7 @@ export function getDefaultPowerShellPath( return powerShellExePath = psCorePaths[0].exePath; } } - + if (use32Bit) { powerShellExePath = platformDetails.isOS64Bit && platformDetails.isProcess64Bit From 4dfe7df54fdf9210a5968953e1ef034c55bbdc7c Mon Sep 17 00:00:00 2001 From: Sydney Smith <43417619+SydneyhSmith@users.noreply.github.com> Date: Mon, 29 Jul 2019 13:37:52 -0700 Subject: [PATCH 19/42] Update platform.ts --- src/platform.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/platform.ts b/src/platform.ts index 08fff786e3..5b1dffb8f2 100644 --- a/src/platform.ts +++ b/src/platform.ts @@ -79,7 +79,7 @@ export function getDefaultPowerShellPath( psCoreInstallPath = (platformDetails.isProcess64Bit ? process.env.ProgramFiles : process.env.ProgramW6432) + "\\PowerShell"; } - + if (fs.existsSync(psCoreInstallPath)) { const arch = platformDetails.isProcess64Bit ? "(x64)" : "(x86)"; const psCorePaths = From a09ee3b51f6a78fb2bfd1338035475d9e5d02774 Mon Sep 17 00:00:00 2001 From: Sydney Smith <43417619+SydneyhSmith@users.noreply.github.com> Date: Tue, 30 Jul 2019 08:56:43 -0700 Subject: [PATCH 20/42] Update platform.test.ts --- test/platform.test.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/platform.test.ts b/test/platform.test.ts index aeddcf4ca4..427a62546f 100644 --- a/test/platform.test.ts +++ b/test/platform.test.ts @@ -46,7 +46,7 @@ suite("Platform module", () => { checkDefaultPowerShellPath( platformDetails, - platform.getAvailablePowerShellExes(platformDetails, undefined)[0].versionName); + platform.getAvailablePowerShellExes(platformDetails, undefined)); checkAvailableWindowsPowerShellPaths( platformDetails, @@ -76,7 +76,7 @@ suite("Platform module", () => { checkDefaultPowerShellPath( platformDetails, - platform.getAvailablePowerShellExes(platformDetails, undefined)[2].versionName); + platform.getAvailablePowerShellExes(platformDetails, undefined)); checkAvailableWindowsPowerShellPaths( platformDetails, @@ -106,7 +106,7 @@ suite("Platform module", () => { checkDefaultPowerShellPath( platformDetails, - platform.getAvailablePowerShellExes(platformDetails, undefined)[1].versionName); + platform.getAvailablePowerShellExes(platformDetails, undefined)); checkAvailableWindowsPowerShellPaths( platformDetails, From bb7fe4a8db6b47d263714ed0ece3b44774a2d596 Mon Sep 17 00:00:00 2001 From: Sydney Smith <43417619+SydneyhSmith@users.noreply.github.com> Date: Tue, 30 Jul 2019 11:24:22 -0700 Subject: [PATCH 21/42] Update platform.test.ts --- test/platform.test.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/platform.test.ts b/test/platform.test.ts index 427a62546f..52925a9a97 100644 --- a/test/platform.test.ts +++ b/test/platform.test.ts @@ -46,7 +46,7 @@ suite("Platform module", () => { checkDefaultPowerShellPath( platformDetails, - platform.getAvailablePowerShellExes(platformDetails, undefined)); + "C:\\Program Files\\PowerShell\\6\\pwsh.exe"); checkAvailableWindowsPowerShellPaths( platformDetails, @@ -76,7 +76,7 @@ suite("Platform module", () => { checkDefaultPowerShellPath( platformDetails, - platform.getAvailablePowerShellExes(platformDetails, undefined)); + "C:\\Program Files\\PowerShell\\6\\pwsh.exe"); checkAvailableWindowsPowerShellPaths( platformDetails, @@ -106,7 +106,7 @@ suite("Platform module", () => { checkDefaultPowerShellPath( platformDetails, - platform.getAvailablePowerShellExes(platformDetails, undefined)); + "C:\\Program Files\\PowerShell\\6\\pwsh.exe"); checkAvailableWindowsPowerShellPaths( platformDetails, From 56f4402cb6cc42ef37f46f5604bd5bc4b724f1d4 Mon Sep 17 00:00:00 2001 From: Sydney Smith <43417619+SydneyhSmith@users.noreply.github.com> Date: Tue, 30 Jul 2019 15:20:31 -0700 Subject: [PATCH 22/42] Update platform.test.ts --- test/platform.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/platform.test.ts b/test/platform.test.ts index 52925a9a97..92d141b340 100644 --- a/test/platform.test.ts +++ b/test/platform.test.ts @@ -46,7 +46,7 @@ suite("Platform module", () => { checkDefaultPowerShellPath( platformDetails, - "C:\\Program Files\\PowerShell\\6\\pwsh.exe"); + platform.SysWow64PowerShellPath); checkAvailableWindowsPowerShellPaths( platformDetails, From 6d8fab8702346f051293a55f86452f97c7ced439 Mon Sep 17 00:00:00 2001 From: Sydney Smith <43417619+SydneyhSmith@users.noreply.github.com> Date: Wed, 31 Jul 2019 10:59:18 -0700 Subject: [PATCH 23/42] Update platform.test.ts --- test/platform.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/platform.test.ts b/test/platform.test.ts index 92d141b340..398ca7560b 100644 --- a/test/platform.test.ts +++ b/test/platform.test.ts @@ -46,7 +46,7 @@ suite("Platform module", () => { checkDefaultPowerShellPath( platformDetails, - platform.SysWow64PowerShellPath); + platform.System32PowerShellPath); checkAvailableWindowsPowerShellPaths( platformDetails, From 6b5e3a92f388de03c17bb5bd6cd37f20a38ad320 Mon Sep 17 00:00:00 2001 From: Sydney Smith <43417619+SydneyhSmith@users.noreply.github.com> Date: Wed, 31 Jul 2019 11:45:31 -0700 Subject: [PATCH 24/42] Update platform.test.ts --- test/platform.test.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/platform.test.ts b/test/platform.test.ts index 398ca7560b..a01f81c191 100644 --- a/test/platform.test.ts +++ b/test/platform.test.ts @@ -76,7 +76,8 @@ suite("Platform module", () => { checkDefaultPowerShellPath( platformDetails, - "C:\\Program Files\\PowerShell\\6\\pwsh.exe"); + platform.getAvailablePowerShellExes(platformDetails, undefined).filter((psPath) => (psPath.versionName) + === "PowerShell Core 6")); checkAvailableWindowsPowerShellPaths( platformDetails, From b9b93ee9bdf5605779cbee609bd2d00d2f291b09 Mon Sep 17 00:00:00 2001 From: Sydney Smith <43417619+SydneyhSmith@users.noreply.github.com> Date: Wed, 31 Jul 2019 11:54:40 -0700 Subject: [PATCH 25/42] Update platform.test.ts --- test/platform.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/platform.test.ts b/test/platform.test.ts index a01f81c191..3f94c31930 100644 --- a/test/platform.test.ts +++ b/test/platform.test.ts @@ -77,7 +77,7 @@ suite("Platform module", () => { checkDefaultPowerShellPath( platformDetails, platform.getAvailablePowerShellExes(platformDetails, undefined).filter((psPath) => (psPath.versionName) - === "PowerShell Core 6")); + === "PowerShell Core 6")[0].exePath); checkAvailableWindowsPowerShellPaths( platformDetails, From c70aecaf548e4aec0d9f45c0e9b623828dd9e943 Mon Sep 17 00:00:00 2001 From: Sydney Smith <43417619+SydneyhSmith@users.noreply.github.com> Date: Wed, 31 Jul 2019 12:26:39 -0700 Subject: [PATCH 26/42] Update platform.test.ts --- test/platform.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/platform.test.ts b/test/platform.test.ts index 3f94c31930..d2f4998958 100644 --- a/test/platform.test.ts +++ b/test/platform.test.ts @@ -77,7 +77,7 @@ suite("Platform module", () => { checkDefaultPowerShellPath( platformDetails, platform.getAvailablePowerShellExes(platformDetails, undefined).filter((psPath) => (psPath.versionName) - === "PowerShell Core 6")[0].exePath); + === "PowerShell Core 6")[0]); checkAvailableWindowsPowerShellPaths( platformDetails, From ed355aeba2d66248962ef4e1896409bb7e0b09e9 Mon Sep 17 00:00:00 2001 From: Sydney Smith <43417619+SydneyhSmith@users.noreply.github.com> Date: Wed, 31 Jul 2019 13:10:02 -0700 Subject: [PATCH 27/42] Update platform.test.ts --- test/platform.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/platform.test.ts b/test/platform.test.ts index d2f4998958..e74c6e4938 100644 --- a/test/platform.test.ts +++ b/test/platform.test.ts @@ -77,7 +77,7 @@ suite("Platform module", () => { checkDefaultPowerShellPath( platformDetails, platform.getAvailablePowerShellExes(platformDetails, undefined).filter((psPath) => (psPath.versionName) - === "PowerShell Core 6")[0]); + === "PowerShell Core 6 (x86)")); checkAvailableWindowsPowerShellPaths( platformDetails, From d788bb787a6bc88dd6d285df702f57ef95f6c97a Mon Sep 17 00:00:00 2001 From: Sydney Smith <43417619+SydneyhSmith@users.noreply.github.com> Date: Wed, 31 Jul 2019 13:27:44 -0700 Subject: [PATCH 28/42] Update platform.test.ts --- test/platform.test.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/platform.test.ts b/test/platform.test.ts index e74c6e4938..757515d720 100644 --- a/test/platform.test.ts +++ b/test/platform.test.ts @@ -77,7 +77,7 @@ suite("Platform module", () => { checkDefaultPowerShellPath( platformDetails, platform.getAvailablePowerShellExes(platformDetails, undefined).filter((psPath) => (psPath.versionName) - === "PowerShell Core 6 (x86)")); + === "PowerShell Core 6 (x86)")[0].exePath); checkAvailableWindowsPowerShellPaths( platformDetails, @@ -107,7 +107,8 @@ suite("Platform module", () => { checkDefaultPowerShellPath( platformDetails, - "C:\\Program Files\\PowerShell\\6\\pwsh.exe"); + platform.getAvailablePowerShellExes(platformDetails, undefined).filter((psPath) => (psPath.versionName) + === "PowerShell Core 6")[0].exePath); checkAvailableWindowsPowerShellPaths( platformDetails, From 9efa922eaf33f333c7e87266cc46537fba1b982d Mon Sep 17 00:00:00 2001 From: Sydney Smith <43417619+SydneyhSmith@users.noreply.github.com> Date: Wed, 31 Jul 2019 13:38:29 -0700 Subject: [PATCH 29/42] Update platform.test.ts --- test/platform.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/platform.test.ts b/test/platform.test.ts index 757515d720..feb2832803 100644 --- a/test/platform.test.ts +++ b/test/platform.test.ts @@ -108,7 +108,7 @@ suite("Platform module", () => { checkDefaultPowerShellPath( platformDetails, platform.getAvailablePowerShellExes(platformDetails, undefined).filter((psPath) => (psPath.versionName) - === "PowerShell Core 6")[0].exePath); + === "PowerShell Core 6 (x86)")[0].exePath); checkAvailableWindowsPowerShellPaths( platformDetails, From 69f9342c33fbd75384f38ff0e7ab15f754d715ca Mon Sep 17 00:00:00 2001 From: Sydney Smith <43417619+SydneyhSmith@users.noreply.github.com> Date: Wed, 31 Jul 2019 14:04:40 -0700 Subject: [PATCH 30/42] Update platform.test.ts --- test/platform.test.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/test/platform.test.ts b/test/platform.test.ts index feb2832803..398ca7560b 100644 --- a/test/platform.test.ts +++ b/test/platform.test.ts @@ -76,8 +76,7 @@ suite("Platform module", () => { checkDefaultPowerShellPath( platformDetails, - platform.getAvailablePowerShellExes(platformDetails, undefined).filter((psPath) => (psPath.versionName) - === "PowerShell Core 6 (x86)")[0].exePath); + "C:\\Program Files\\PowerShell\\6\\pwsh.exe"); checkAvailableWindowsPowerShellPaths( platformDetails, @@ -107,8 +106,7 @@ suite("Platform module", () => { checkDefaultPowerShellPath( platformDetails, - platform.getAvailablePowerShellExes(platformDetails, undefined).filter((psPath) => (psPath.versionName) - === "PowerShell Core 6 (x86)")[0].exePath); + "C:\\Program Files\\PowerShell\\6\\pwsh.exe"); checkAvailableWindowsPowerShellPaths( platformDetails, From bd8eeb09b03f0fefb1002650f6e59d9576af5459 Mon Sep 17 00:00:00 2001 From: Sydney Smith <43417619+SydneyhSmith@users.noreply.github.com> Date: Tue, 6 Aug 2019 15:38:49 -0700 Subject: [PATCH 31/42] Update src/platform.ts Co-Authored-By: Tyler James Leonhardt --- src/platform.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/platform.ts b/src/platform.ts index 5b1dffb8f2..17ee35229c 100644 --- a/src/platform.ts +++ b/src/platform.ts @@ -101,7 +101,7 @@ export function getDefaultPowerShellPath( if (use32Bit) { powerShellExePath = - platformDetails.isOS64Bit && platformDetails.isProcess64Bit + return platformDetails.isOS64Bit && platformDetails.isProcess64Bit ? SysWow64PowerShellPath : System32PowerShellPath; } else { From 059c7827a32d7224dd807b047c8499a216e761e9 Mon Sep 17 00:00:00 2001 From: Sydney Smith <43417619+SydneyhSmith@users.noreply.github.com> Date: Tue, 6 Aug 2019 15:39:01 -0700 Subject: [PATCH 32/42] Update src/platform.ts Co-Authored-By: Tyler James Leonhardt --- src/platform.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/platform.ts b/src/platform.ts index 17ee35229c..de7aea2d7e 100644 --- a/src/platform.ts +++ b/src/platform.ts @@ -106,7 +106,7 @@ export function getDefaultPowerShellPath( : System32PowerShellPath; } else { powerShellExePath = - !platformDetails.isOS64Bit || platformDetails.isProcess64Bit + return !platformDetails.isOS64Bit || platformDetails.isProcess64Bit ? System32PowerShellPath : SysnativePowerShellPath; } From 35c5e10985e93402a45d5e7c61b76c2bb1d34c46 Mon Sep 17 00:00:00 2001 From: Sydney Smith <43417619+SydneyhSmith@users.noreply.github.com> Date: Tue, 6 Aug 2019 15:43:05 -0700 Subject: [PATCH 33/42] Update platform.ts --- src/platform.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/platform.ts b/src/platform.ts index de7aea2d7e..8a2c227172 100644 --- a/src/platform.ts +++ b/src/platform.ts @@ -90,7 +90,7 @@ export function getDefaultPowerShellPath( return fs.lstatSync(item).isDirectory() && fs.existsSync(exePath); }) .map((item) => ({ - versionName: `PowerShell Core ${path.parse(item).base} ${arch}`, + versionName: `PowerShell ${path.parse(item).base} ${arch}`, exePath: path.join(item, "pwsh.exe"), })); @@ -208,7 +208,7 @@ export function getAvailablePowerShellExes( return fs.lstatSync(item).isDirectory() && fs.existsSync(exePath); }) .map((item) => ({ - versionName: `PowerShell Core ${path.parse(item).base} ${arch}`, + versionName: `PowerShell ${path.parse(item).base} ${arch}`, exePath: path.join(item, "pwsh.exe"), })); @@ -229,7 +229,7 @@ export function getAvailablePowerShellExes( exePaths.forEach((exePath) => { if (fs.existsSync(exePath)) { paths.push({ - versionName: "PowerShell Core" + (/-preview/.test(exePath) ? " Preview" : ""), + versionName: "PowerShell " + (/-preview/.test(exePath) ? " Preview" : ""), exePath, }); } From aa3f354c6d61ac48b45f720cf6fb47eda54c0277 Mon Sep 17 00:00:00 2001 From: Sydney Smith <43417619+SydneyhSmith@users.noreply.github.com> Date: Tue, 6 Aug 2019 15:44:53 -0700 Subject: [PATCH 34/42] Update platform.ts --- src/platform.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/platform.ts b/src/platform.ts index 8a2c227172..77b7d43bd3 100644 --- a/src/platform.ts +++ b/src/platform.ts @@ -229,7 +229,7 @@ export function getAvailablePowerShellExes( exePaths.forEach((exePath) => { if (fs.existsSync(exePath)) { paths.push({ - versionName: "PowerShell " + (/-preview/.test(exePath) ? " Preview" : ""), + versionName: "PowerShell" + (/-preview/.test(exePath) ? " Preview" : ""), exePath, }); } From 9c5ca2cf27b088f505d3c10cbfec2d073bb9967b Mon Sep 17 00:00:00 2001 From: Sydney Smith <43417619+SydneyhSmith@users.noreply.github.com> Date: Tue, 6 Aug 2019 15:51:21 -0700 Subject: [PATCH 35/42] Update platform.ts --- src/platform.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/platform.ts b/src/platform.ts index 77b7d43bd3..0693797eac 100644 --- a/src/platform.ts +++ b/src/platform.ts @@ -100,12 +100,10 @@ export function getDefaultPowerShellPath( } if (use32Bit) { - powerShellExePath = return platformDetails.isOS64Bit && platformDetails.isProcess64Bit ? SysWow64PowerShellPath : System32PowerShellPath; } else { - powerShellExePath = return !platformDetails.isOS64Bit || platformDetails.isProcess64Bit ? System32PowerShellPath : SysnativePowerShellPath; From b405e00a570347cdf365efac4a10f0af7c3c776d Mon Sep 17 00:00:00 2001 From: Sydney Smith <43417619+SydneyhSmith@users.noreply.github.com> Date: Thu, 22 Aug 2019 08:57:03 -0700 Subject: [PATCH 36/42] Update src/platform.ts Co-Authored-By: Tyler James Leonhardt --- src/platform.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/platform.ts b/src/platform.ts index 0693797eac..022a9e159d 100644 --- a/src/platform.ts +++ b/src/platform.ts @@ -99,6 +99,7 @@ export function getDefaultPowerShellPath( } } + // No PowerShell 6+ detected so use Windows PowerShell. if (use32Bit) { return platformDetails.isOS64Bit && platformDetails.isProcess64Bit ? SysWow64PowerShellPath From 40f1649af38e42291336d37fdfa128f5e485c4d8 Mon Sep 17 00:00:00 2001 From: Sydney Smith <43417619+SydneyhSmith@users.noreply.github.com> Date: Thu, 22 Aug 2019 09:26:04 -0700 Subject: [PATCH 37/42] Update platform.ts --- src/platform.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/platform.ts b/src/platform.ts index 022a9e159d..831194e7c8 100644 --- a/src/platform.ts +++ b/src/platform.ts @@ -104,12 +104,11 @@ export function getDefaultPowerShellPath( return platformDetails.isOS64Bit && platformDetails.isProcess64Bit ? SysWow64PowerShellPath : System32PowerShellPath; - } else { + } return !platformDetails.isOS64Bit || platformDetails.isProcess64Bit ? System32PowerShellPath : SysnativePowerShellPath; - } - } else if (platformDetails.operatingSystem === OperatingSystem.MacOS) { + } if (platformDetails.operatingSystem === OperatingSystem.MacOS) { // Always default to the stable version of PowerShell (if installed) but handle case of only Preview installed powerShellExePath = macOSExePath; if (!fs.existsSync(macOSExePath) && fs.existsSync(macOSPreviewExePath)) { From af96894e8b09016bd9691d8d293adbdddfc85cde Mon Sep 17 00:00:00 2001 From: Sydney Smith <43417619+SydneyhSmith@users.noreply.github.com> Date: Thu, 22 Aug 2019 09:55:24 -0700 Subject: [PATCH 38/42] Update platform.ts --- src/platform.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/platform.ts b/src/platform.ts index 831194e7c8..1ec6235cce 100644 --- a/src/platform.ts +++ b/src/platform.ts @@ -105,10 +105,10 @@ export function getDefaultPowerShellPath( ? SysWow64PowerShellPath : System32PowerShellPath; } - return !platformDetails.isOS64Bit || platformDetails.isProcess64Bit - ? System32PowerShellPath - : SysnativePowerShellPath; - } if (platformDetails.operatingSystem === OperatingSystem.MacOS) { + return !platformDetails.isOS64Bit || platformDetails.isProcess64Bit + ? System32PowerShellPath + : SysnativePowerShellPath; + } if (platformDetails.operatingSystem === OperatingSystem.MacOS) { // Always default to the stable version of PowerShell (if installed) but handle case of only Preview installed powerShellExePath = macOSExePath; if (!fs.existsSync(macOSExePath) && fs.existsSync(macOSPreviewExePath)) { From b15caad60e984968e954b9976e3e902b706d5206 Mon Sep 17 00:00:00 2001 From: Sydney Smith <43417619+SydneyhSmith@users.noreply.github.com> Date: Thu, 22 Aug 2019 10:06:03 -0700 Subject: [PATCH 39/42] Update platform.ts --- src/platform.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/platform.ts b/src/platform.ts index 1ec6235cce..6db5254367 100644 --- a/src/platform.ts +++ b/src/platform.ts @@ -108,7 +108,7 @@ export function getDefaultPowerShellPath( return !platformDetails.isOS64Bit || platformDetails.isProcess64Bit ? System32PowerShellPath : SysnativePowerShellPath; - } if (platformDetails.operatingSystem === OperatingSystem.MacOS) { + } if (platformDetails.operatingSystem === OperatingSystem.MacOS) { // Always default to the stable version of PowerShell (if installed) but handle case of only Preview installed powerShellExePath = macOSExePath; if (!fs.existsSync(macOSExePath) && fs.existsSync(macOSPreviewExePath)) { From 768bacf1d3033c1ce3ddc2b3cb027fa3ca086cc9 Mon Sep 17 00:00:00 2001 From: Sydney Smith <43417619+SydneyhSmith@users.noreply.github.com> Date: Thu, 22 Aug 2019 10:25:05 -0700 Subject: [PATCH 40/42] Update platform.ts --- src/platform.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/platform.ts b/src/platform.ts index 6db5254367..9d6a48b6b1 100644 --- a/src/platform.ts +++ b/src/platform.ts @@ -108,11 +108,11 @@ export function getDefaultPowerShellPath( return !platformDetails.isOS64Bit || platformDetails.isProcess64Bit ? System32PowerShellPath : SysnativePowerShellPath; - } if (platformDetails.operatingSystem === OperatingSystem.MacOS) { + } if (platformDetails.operatingSystem === OperatingSystem.MacOS) { // Always default to the stable version of PowerShell (if installed) but handle case of only Preview installed - powerShellExePath = macOSExePath; - if (!fs.existsSync(macOSExePath) && fs.existsSync(macOSPreviewExePath)) { - powerShellExePath = macOSPreviewExePath; + powerShellExePath = macOSExePath; + if (!fs.existsSync(macOSExePath) && fs.existsSync(macOSPreviewExePath)) { + powerShellExePath = macOSPreviewExePath; } } else if (platformDetails.operatingSystem === OperatingSystem.Linux) { // Always default to the stable version of PowerShell (if installed) but handle case of only Preview installed From b3df4bb4e5e47675c50a07359e81ac84a0cc61aa Mon Sep 17 00:00:00 2001 From: Sydney Smith <43417619+SydneyhSmith@users.noreply.github.com> Date: Thu, 22 Aug 2019 10:28:32 -0700 Subject: [PATCH 41/42] Update platform.ts --- src/platform.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/platform.ts b/src/platform.ts index 9d6a48b6b1..53a8424d7a 100644 --- a/src/platform.ts +++ b/src/platform.ts @@ -108,12 +108,13 @@ export function getDefaultPowerShellPath( return !platformDetails.isOS64Bit || platformDetails.isProcess64Bit ? System32PowerShellPath : SysnativePowerShellPath; - } if (platformDetails.operatingSystem === OperatingSystem.MacOS) { + } + if (platformDetails.operatingSystem === OperatingSystem.MacOS) { // Always default to the stable version of PowerShell (if installed) but handle case of only Preview installed - powerShellExePath = macOSExePath; - if (!fs.existsSync(macOSExePath) && fs.existsSync(macOSPreviewExePath)) { - powerShellExePath = macOSPreviewExePath; - } + powerShellExePath = macOSExePath; + if (!fs.existsSync(macOSExePath) && fs.existsSync(macOSPreviewExePath)) { + powerShellExePath = macOSPreviewExePath; + } } else if (platformDetails.operatingSystem === OperatingSystem.Linux) { // Always default to the stable version of PowerShell (if installed) but handle case of only Preview installed // as well as the Snaps case - https://snapcraft.io/ From 1c620bb2cb33f2e68be09ba787780dcf5f2d44ed Mon Sep 17 00:00:00 2001 From: Sydney Smith <43417619+SydneyhSmith@users.noreply.github.com> Date: Thu, 22 Aug 2019 10:42:02 -0700 Subject: [PATCH 42/42] Update platform.ts --- src/platform.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/platform.ts b/src/platform.ts index 53a8424d7a..2cede17892 100644 --- a/src/platform.ts +++ b/src/platform.ts @@ -108,7 +108,7 @@ export function getDefaultPowerShellPath( return !platformDetails.isOS64Bit || platformDetails.isProcess64Bit ? System32PowerShellPath : SysnativePowerShellPath; - } + } if (platformDetails.operatingSystem === OperatingSystem.MacOS) { // Always default to the stable version of PowerShell (if installed) but handle case of only Preview installed powerShellExePath = macOSExePath;