-
Notifications
You must be signed in to change notification settings - Fork 513
Set Default PowerShell Version on Windows to Latest Available #2094
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
Conversation
Checks for PowerShell Core on Windows OS, if exists uses the latest version of PowerShell as the default PowerShell path
Removes SSL check
Windows core check
Co-Authored-By: Tyler James Leonhardt <tylerl0706@gmail.com>
This makes the assumption that the user has chosen the default MSI installation path. Ideally we should query the registry for it. However, currently the installer does not create a registry key for it, so we can't do that now. Going forward we should fix that though using something like this: https://stackoverflow.com/a/13451210/1810304 |
Well that explains why Win+R > pwsh launches a different pwsh than cmd > pwsh. Windows Run looks to App Paths before it looks to the Path variable, and so it's launching 7 Preview for me, while cmd looks to the path only and thus launches 6.2.2. I believe what @bergmeister is referring to is the |
Co-Authored-By: Christoph Bergmeister [MVP] <c.bergmeister@gmail.com>
Yeah that makes sense - I think we should default to the install location (what Sydney already has) rather than switch to the App Paths. |
src/platform.ts
Outdated
? SysWow64PowerShellPath | ||
: System32PowerShellPath; | ||
psCoreInstallPath = | ||
(platformDetails.isProcess64Bit ? process.env["ProgramFiles(x86)"] : process.env.ProgramFiles) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor-nit but to maintain the coding style this line and line 81 should be indented four more spaces.
Oh, I forgot we had this one as well. Normally apps, register a key for the uninstall location but the one that you references is perfectly fine and does the job as well :-) |
Co-Authored-By: Tyler James Leonhardt <tylerl0706@gmail.com>
Co-Authored-By: Tyler James Leonhardt <tylerl0706@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - just a single comment addition
Co-Authored-By: Tyler James Leonhardt <tylerl0706@gmail.com>
Set Default PowerShell Version on Windows to Latest Available
* Merge pull request #2094 from SydneyhSmith/master Set Default PowerShell Version on Windows to Latest Available * Update platform.test.ts * Update src/platform.ts Co-Authored-By: Tyler James Leonhardt <tylerl0706@gmail.com>
PR Summary
Updated the default PowerShell path on Windows to check for the latest version (previous behavior defaulted to Windows PowerShell). Also removed an SSL check that is no longer necessary.
PR Checklist
Note: Tick the boxes below that apply to this pull request by putting an
x
between the square brackets.Please mark anything not applicable to this PR
NA
.WIP:
to the beginning of the title and remove the prefix when the PR is ready