Repository navigation
Remove the Update Notification feature from PowerShell - #28242
Dongbo Wang (daxian-dbw) merged 1 commit into
Conversation
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
There was a problem hiding this comment.
🟢 Approval recommended
The removal is self-contained, preserves startup-banner assertions, and has no identified blocking issues.
No open issues 🎉
What changed in this PR
Removes PowerShell’s in-product update notifications, eliminating the startup crash path described in #28131 and associated background processing.
Changes:
- Remove release checks, notification display, and cache-management implementation.
- Remove default notification strings; localized cleanup is deferred to the Localization Pipeline.
- Remove obsolete update-check environment setup from startup-banner tests.
| File | Description |
|---|---|
| test/powershell/Host/ConsoleHost.Tests.ps1 | Remove obsolete environment setup and restoration. |
| src/Microsoft.PowerShell.ConsoleHost/resources/ManagedEntranceStrings.resx | Remove default notification strings. |
| src/Microsoft.PowerShell.ConsoleHost/host/msh/UpdatesNotification.cs | Delete the notification implementation. |
| src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHost.cs | Remove background update-check startup. |
| src/Microsoft.PowerShell.ConsoleHost/host/msh/CommandLineParameterParser.cs | Remove notification display from the banner. |
Review effort: Balanced
02e9e0c
into
PowerShell:master
|
How will Linux installs that used tar.gz files be notified about an update being available ? Seems like that use case was forgotten.... |
|
This PR closes this following discussion Joe S (@JoeSalmeri) - Put simply they won't be notified & users that are using that install method will need to look to implement their own update check & install logic. My feeling is that the team felt if users are using that method for install on linux or MacOS or zip installs on Windows then they should already be capable of managing their own update check & install process. Which can be done in a few lines of PowerShell easily enough via calling either
|
|
Ryan Yates (@kilasuit) - That seems like a leap to assume a typical user that downloaded a software package from Install PowerShell 7 on macOS once is ever going to go back and check it again manually. It isn't like there haven't been significant CVE's that have needed patching recently that put Linux and macOS users at risk. Feels like the 'security is a priority' focus went out the window with this decision. |
I already wrote a pwsh script to install a specific version pwsh version and I already check the releases website periodically to check for updates and read about changes, but the notification was also a reminder for me to check. Thanks for the example script to check for update, I appreciate it. |
I agree, seems like a bad decision but at least there is a way we can restore the functionality with a few lines of code. |
|
This is a poor decision. Since I don't manage PowerShell through the Microsoft Store, I have no way of knowing if a patch is needed without the update notification. I don't understand why a perfectly normal function is being removed over a culture issue. |
|
kjwsge I can give you some history behind this, and whilst it may seem like being removed over culture issues, there's much more to it than just that & has been on the teams mind to do this for some time as mentioned in this discussion This feature, whilst well intentioned when it was added, has caused a number of unnecessary issues being raised in this repository, usually each month a new PowerShell version was released, and often multiple of them a month. This was mostly because of PowerShell having been released here on GitHub, but not being Then we'd have people (including myself) asking things like Also the amount of code that was required for this feature , as it was & without adding those additional requests, really wasn't worth it for the benefit it provided. Plus there had been many requests for this feature to be removed, due to it not being flexible enough, and for others, because it was completely useless to them. Now balance this with that you can add into your PowerShell Profile as little as the below amounts of code which you can customise that'll tell you if there is a new PowerShell version to update to or not every time you start a PowerShell session. using 1 liner and the gh cli tool if you use it if((gh release list --repo PowerShell/PowerShell --json tagName --limit 1 --exclude-pre-releases | convertfrom-json).tagName.replace('v','') -notmatch $PSVersionTable.PSVersion.ToString()) {Write-Host 'New PowerShell version released' -ForegroundColor Green} else {Write-Host 'No New PowerShell version released' -ForegroundColor red}or if the existing endpoint for the latest Stable release that the update notification used $psstableTag = (irm https://aka.ms/pwsh-buildinfo-stable).ReleaseTag.replace('v','')
if ($psstableTag -match $PSVersionTable.PSVersion) {'No new PowerShell Release yet'}else{'There is a new PowerShell Release'}or perhaps directly from the GitHub Releases RestAPI (which doesn't require auth token to pull data from) looking for the last release in the 7.6 or 7.7 releases but only output it if was in the last 15 days. $days = -15
$psr = irm https://api.github.com/repos/powershell/powershell/releases
$76 = $psr | Select name,created_at,tag_name,html_url | where tag_name -Match '7.6' | select -First 1
$77 = $psr | Select name,created_at,tag_name,html_url | where tag_name -Match '7.7' | select -First 1
if ($76.created_at -gt (get-date).AddDays($days)) {
Write-Output "New PSRelease 7.6 available: $($76.tag_name) - $($76.html_url)"
}
if ($77.created_at -gt (get-date).AddDays($days)) {
Write-Output "New PSRelease 7.7 available: $($77.tag_name) - $($77.html_url)"
}I am already making use of an adapted version of that last block of code in my profile that runs as a ThreadJob on startup that adds a section to my prompt if there are 1 or more new PowerShell Releases that I am interested in since I last let it check.
I hope from reading the above you can understand why the team had decided that they wanted to remove the Update Notification feature, & with it having this issue crop up now with localisation of the messages this feature provided, was no longer worth spending more engineering time or effort in fixing & why they ultimately chose to remove it now. Yes there will be some that will miss this feature, there's there's many that likely won't miss that it's gone & many that even if they were making use of it, well now they get the chance to build themselves something similar, but more flexible & that they can customise however suits them best going forward & for a lot less code. I would have preferred changing the message to say "this feature is getting removed in the next release" & then removing it, but the time frame between the 7.6.6 & 7.6.9 releases wouldn't have allowed to get that change in anyway. I have proposed an update to the about_Update_Notification document for the 7.6 docs to include a section about the removal of this feature, as I don't think ripping the doc out straight away is the right approach, & that this feature can be easily replicated if needed pointing to the docs for the gh cli, GitHub Rest API & also to the metadata.json file in this repository that you can also query if you wanted. |
I appreciate the background but this was handled poorly. If the feature was going to be removed that should have been announced in advance, and only after documentation on how to enable notifications within your profile was added to the installation learn pages and mentioned in the release notes. I'm not sure how a typical user would find any of this information and the recommended installation method for macOS users still leaves them with no obvious way to ever know they're on an outdated version. https://learn.microsoft.com/en-us/powershell/scripting/install/install-powershell-on-macos?view=powershell-7.6 Then again, the documentation also points users to 7.6.6 and the referenced Changelog stops at 7.6.4.
|
|
kwtobin - yeah it could have been handled better. I did note about the outdated versions being referenced on the Install PowerShell 7 on macOS page, but could you clarify what you mean about or point me to where |
|
Ryan Yates (@kilasuit) - Sorry, I should have been more clear on that. The What's New in PowerShell section on the sidebar, and particularly, What's New in PowerShell 7.6 (https://learn.microsoft.com/en-us/powershell/scripting/whats-new/what-s-new-in-powershell-76?view=powershell-7.6) links to https://github.com/PowerShell/PowerShell/blob/master/CHANGELOG/7.6.md.
|


PR Summary
Fix #28131
Remove the Update Notification feature from PowerShell.
PowerShell servicing delivery through Microsoft Update has become increasingly mature and reliable, while PowerShell installed as an MSIX app can update automatically through the Microsoft Store. As these update mechanisms have improved, the in-product Update Notification provides increasingly limited additional value.
Removing the feature also eliminates its background network request, local cache and synchronization logic, startup notification, and associated maintenance overhead.
Changes
UpdatesNotificationimplementation and its cache-management logic.POWERSHELL_UPDATECHECKsetup from the startup banner tests.PR Checklist
.h,.cpp,.cs,.ps1and.psm1files have the correct copyright header