Skip to content

Make PowerShell names case insensitive for configuration #2399

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 7, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,8 @@ export class SessionManager implements Middleware {
let powerShellExeDetails;
if (this.sessionSettings.powerShellDefaultVersion) {
for (const details of this.powershellExeFinder.enumeratePowerShellInstallations()) {
if (details.displayName === this.sessionSettings.powerShellDefaultVersion) {
const wantedName = this.sessionSettings.powerShellDefaultVersion;
if (wantedName.localeCompare(details.displayName, undefined, { sensitivity: "accent" }) === 0) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the undefined?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The locales parameter. Taken from this SO answer. There doesn't seem to be a more elegant way to do it unfortunately.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you maybe throw that link to SO here in a comment?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ehhh or you don't have to. It's not that important

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

powerShellExeDetails = details;
break;
}
Expand Down