-
Notifications
You must be signed in to change notification settings - Fork 499
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
Prompt to update PowerShell version #2105
Prompt to update PowerShell version #2105
Conversation
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.
Good idea and relatively simple implementation (+1) for such a nice functionality. I think it needs some tweaks but otherwise looks good, don't be put off by the amount of comments.
src/features/UpdatePowerShell.ts
Outdated
|
||
const PowerShellGitHubReleasesUrl = | ||
"https://api.github.com/repos/PowerShell/PowerShell/releases/latest"; | ||
const PowerShellGitHubRPrereleasesUrl = |
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.
PowerShellGitHubRPrereleasesUrl
--> PowerShellGitHubPrereleasesUrl
?
I really like this. My only concern (running macOS) is that the user might not have Brew installed, is there a check in here for that? A quick Google returned this, which might help? https://stackoverflow.com/questions/21577968/how-to-tell-if-homebrew-is-installed-on-mac-os-x |
@GHRoss Good suggestion! Since we're in typescript though, we'd want to use a node.js way of finding out if we have brew which sadly would require yet another package to be brought in. Considering we'd have to do this, or something less than ideal like execute That said, as a compromise, I'll have the dialog explicitly say it'll use |
p.s. @rjmholt ... better "never" text? |
I think I've addressed all feedback here |
Co-Authored-By: Christoph Bergmeister [MVP] <[email protected]>
Co-Authored-By: Christoph Bergmeister [MVP] <[email protected]>
…powershell into update-powershell
@bergmeister I've addressed all your feedback - I'm going to merge this in today or tomorrow for a release unless you have any more feedback |
I will try to backport this to legacy but if it doesn't go well I'm ok keeping this in Preview |
* prompt to update PowerShell version * address all feedback * say homebrew is used * Feedback Co-Authored-By: Christoph Bergmeister [MVP] <[email protected]> * Feedback Co-Authored-By: Christoph Bergmeister [MVP] <[email protected]> * PR feedback * use correct url from github api
* prompt to update PowerShell version * address all feedback * say homebrew is used * Feedback Co-Authored-By: Christoph Bergmeister [MVP] <[email protected]> * Feedback Co-Authored-By: Christoph Bergmeister [MVP] <[email protected]> * PR feedback * use correct url from github api
PR Summary
This adds a little dialog that informs you that you can update your version of PowerShell.
It will update:
6.0 - 6.2.1 -> 6.2.2
any preview version -> 7.0.0-preview.2
here's an example:
It updates via homebrew on macOS and through the MSI (interactively) on Windows.
Linux is not supported.
This won't "update" Windows PowerShell to PowerShell 6+ yet as it's a trickier situation.
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