Skip to content

Commit df67d6b

Browse files
authored
Update platform.ts
1 parent 29cde1b commit df67d6b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/platform.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,12 @@ export function getDefaultPowerShellPath(
7373
if (platformDetails.operatingSystem === OperatingSystem.Windows) {
7474
if (use32Bit) {
7575
psCoreInstallPath =
76-
(platformDetails.isProcess64Bit ? process.env.ProgramW6432 : process.env.ProgramFiles) + "\\PowerShell";
76+
(platformDetails.isProcess64Bit ? process.env['ProgramFiles(x86)'] : process.env.ProgramFiles)
77+
+ "\\PowerShell";
7778
} else {
7879

79-
psCoreInstallPath = psCoreInstallPath = process.env.ProgramFiles + "\\PowerShell";
80+
psCoreInstallPath =
81+
(platformDetails.isProcess64Bit ? process.env.ProgramFiles : process.env.ProgramW6432) + "\\PowerShell";
8082
}
8183
if (fs.existsSync(psCoreInstallPath)) {
8284
const arch = platformDetails.isProcess64Bit ? "(x64)" : "(x86)";

0 commit comments

Comments
 (0)