diff --git a/src/platform.ts b/src/platform.ts index e092c14411..34271fa398 100644 --- a/src/platform.ts +++ b/src/platform.ts @@ -94,7 +94,7 @@ export function getDefaultPowerShellPath( exePath: path.join(item, "pwsh.exe"), })); - if (psCorePaths) { + if (psCorePaths && psCorePaths.length > 0) { return powerShellExePath = psCorePaths[0].exePath; } }