Skip to content

Commit 17c520a

Browse files
authored
Make PowerShell names case insensitive for configuration (#2399)
1 parent f2c925d commit 17c520a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/session.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,9 @@ export class SessionManager implements Middleware {
127127
let powerShellExeDetails;
128128
if (this.sessionSettings.powerShellDefaultVersion) {
129129
for (const details of this.powershellExeFinder.enumeratePowerShellInstallations()) {
130-
if (details.displayName === this.sessionSettings.powerShellDefaultVersion) {
130+
// Need to compare names case-insensitively, from https://stackoverflow.com/a/2140723
131+
const wantedName = this.sessionSettings.powerShellDefaultVersion;
132+
if (wantedName.localeCompare(details.displayName, undefined, { sensitivity: "accent" }) === 0) {
131133
powerShellExeDetails = details;
132134
break;
133135
}

0 commit comments

Comments
 (0)