You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Consistent "LTS" version naming or tagging across versions/platforms #25261
In comparison the dotnet-install-script does allow you to specify a channel, which can be set to LTS.
Regarding the Package file naming
First exclude deb and rpm packages. These have their own naming convention that is not defined by either Microsoft or PowerShell and should also match with the files in debian packages and rpm packages.
For the remainder, the os-architecture pair should be the same as the .NET RID for the package, these use hyphen between the fields.
I don't see any issue with the current filenames.
I suggest the fix should be to align the command line options in install-powershell.ps1 with dotnet-install.ps1.
It hasn't really been a "supported" or recommended tool
That's why it's not mentioned in the official docs
It was a stop gap for installing in CI but has continued to be of use outside of it's originial intended purpose.
As such it's not a high priority for the team to update it when there is new functionality, like new MSI config options or like I how I had been using it to enable an install of a small selection of versions side by side whilst trying to help in reproducing bugs that have been submitted here & elsewhere (like in the PowerShell Discord/Slack community) on the versions that they had been reported on as well as ones released since then.
Ideally, I'd like it to be a supported, documented & importantly is a signed script that is published to the gallery, as an output from this repo as to reduce the need for others to have to produce the same script in their own organisations. But that means it needs additional work to achieve.
I've previously asked for scripts in this repo to be signed where possible which was entirely because of this script.
Steve Lee (@SteveL-MSFT) mentioned in Please sign any .ps1 scripts in this repository #8814 (comment) this could be an interim thing prior to there being the now withdrawn RFC for an installer utility Module PowerShell Core Installer/Utility Module PowerShell-RFC#97 - however I don't see it being all that much work to complete the changes needed (detailed below) and add a build, sign, release & test mechanism for this script so that it can in future be a supported mechanism where orgs/individuals may be working in environments where they don't want/can't use other available solutions like WinGet or the Store & don't want/shouldn't need to resort to their own hacky scripts to do so.
unless someone else picks up that work I will get back to it soon
I haven't deleted the branch from that PR incase anyone wanted to start from where I was.
I intended starting on a new branch to ensure cleanliness and to make reviewing one or more replacement/supplement PR's simpler & quicker.
Before I do, I intended to have the scope of the work tied down, and ensure that as many if not all the changes that have happened in the last 21+ months / 91+ weeks that would affect it could be added altogether.
I realise because of 1) & other things that the PR dragged out somewhat and could have been handled better by myself and that work on it should have been merged some time ago. Alas we are where we are but my intent is a minor redesign to add flexibility to be able to install any previous or future release where there is a released artifcat including binaries or a compressed archive that can be publicly used for install, unlike with the 7.4.8 & 7.4.9 tags
They do call out The installation commands in this article are for the latest stable release of PowerShell. To install a different version of PowerShell, adjust the command to match the version you need. which
Their preferred example uses WinGet and does not offer an LTS release.
Not true, Winget has an explicit --version / -v parameter that can be used to install any previous version of the Microsoft.PowerShell Package which also includes all LTS versions under the Microsoft.PowerShell ID code in winget (which are any 7.even.x release that is not marked as a preview release)
I believe that this is also partly why 237dmitry none of the windows assets are named with lts & is in some ways also because PowerShell is internally seen to Windows using the same product-id & how the LTS/Stable releases are installed in C:\Program Files\PowerShell\7\ whereas the preview is installed in C:\Program Files\PowerShell\7-preview\ & that an upgrade from LTS -> Stable isn't something that the team wanted to do automatically for you if you had opted into Microsoft Update, as that will only update from Current LTS verison to LTS +1, so from 7.4.7 to what likely is going to be 7.4.10 & not to the 7.5.0 branch of releases.
This is for me the right way forward as moving from LTS to STS should be informed decision to do so and helps to enable phased roll outs across individuals/organisations & is controlled by the documented environment vairiable for the update notfication behaviour
It also allows for an easy mechanism for the move from one LTS Major version to another, like from 7.2.x to 7.4.x that happened earlier on this year.
It also allows the move from LTS to STS and back as needed. Or so is my understanding
So to install the LTS you need to call it as such winget install --id Microsoft.PowerShell -v 7.4.7.0
I suggest the fix should be to align the command line options in install-powershell.ps1 with dotnet-install.ps1.
They are different tools doing different albeit similar things & managed by 2 different teams from 2 very different areas at Microsoft which to me means it's very very unlikely that alignment in functionality will happen, bar the bits I've mentioned above however can some of the design of that script be
jman (@jman61) - whilst unsupported the below sample code (I tested earlier against a Windows Sandbox) based on the blog post I authored above & the PR I abandoned would allow you to do a single machine, interactive quiet install using the MSI but doesn't have all the flags that the MSI has had added in all this time as I mentioned in 2)
If Steve Lee (@SteveL-MSFT) gives the ok for this script to be extended like I've suggested and then can be released as as signed script which is then published as it's own artifact and pushed to the gallery then I'll happily find the time to work on it either next week or the week after with any members of the team as needed to make sure that we get all the current needed features and that any possible future updates that may be needed to the script are also added in a timely manner like if there were any new additions like MSI flags etc.
It is the PSSummit next week, so perhaps conversations there may help around all the above.
Oh and an interesting additional area I found over the years included that you can also by using these RegKeys ask Microsoft Update to actually install PowerShell & then update it for you (not that it's well known) you can then preset all the regkeys the MSI installer would set up post install to keep the install configuration consistent between installs - this is most of what configuration options are currently missing in the install-powershell.ps1 script in its current form but would be included if Steve Lee (@SteveL-MSFT) gives the ok to do so unless there is anything coming soon enough that should make this work unnecessary like the teams ask in this discussion
The above should help you understand the additional mechanisms that aren't documented as supported, though I think they should be documented as supported going forward, but that's for the team to decide.
That was fun to test out and writeup and quite the trip down memory lane too & I hope is useful to all that read it & all the links.
Hello all - my first github powershell post - very cool discussion, I had a feeling this had been addressed before, didn't see it.
My goals with this request was to lessen "chasing upgrades" for a production setting, and go for a long-term-support model that I saw in the github site and elsewhere. I need automation, not manual process for this, so I'll rethink my approach.
Responses to the comments in the order I remember them:
first thanks Ryan Yates (@kilasuit) for the script above to get LTS - it works! (edit: thought there was a typo, may have been my own mistake) I will try this for non-prod until I see the effect of this. I will need some modicum of support from MS updates or easier github download.
I will try the suggestion for "POWERSHELL_UPDATECHECK=LTS" in the system's environment variable.
Please accept my vote for making a change and permitting an LTS option in windows updates and downloads. I realize there's a lot of knock-on effects, but worthy. It's there for Non-Windows, should be there for the Win OS.
I forgot about the *nix updates naming standards - I agree their standard should be followed. Apologies!
Activity
rhubarb-geek-nz commentedon Mar 31, 2025
A few observations
The installation instructions for PowerShell don't explain how to get an LTS release.
Their preferred example uses WinGet and does not offer an LTS release.
As mentioned neither does the script at tools/install-powershell.ps1 mention LTS.
In comparison the dotnet-install-script does allow you to specify a channel, which can be set to LTS.
Regarding the Package file naming
First exclude
debandrpmpackages. These have their own naming convention that is not defined by either Microsoft or PowerShell and should also match with the files in debian packages and rpm packages.For the remainder, the os-architecture pair should be the same as the .NET RID for the package, these use hyphen between the fields.
I don't see any issue with the current filenames.
I suggest the fix should be to align the command line options in
install-powershell.ps1withdotnet-install.ps1.237dmitry commentedon Mar 31, 2025
There are not windows lts releases in github releases. I do not know why:
kilasuit commentedon Apr 4, 2025
Let me give some background from my knowledge, having spent plently of time with the install-powershell.ps1 script over the years and having used and extended it as blogged in this post - Installing PowerShell Side by Side for testing purposes - back in September 2023
It hasn't really been a "supported" or recommended tool
That's why it's not mentioned in the official docs
It was a stop gap for installing in CI but has continued to be of use outside of it's originial intended purpose.
As such it's not a high priority for the team to update it when there is new functionality, like new MSI config options or like I how I had been using it to enable an install of a small selection of versions side by side whilst trying to help in reproducing bugs that have been submitted here & elsewhere (like in the PowerShell Discord/Slack community) on the versions that they had been reported on as well as ones released since then.
Ideally, I'd like it to be a supported, documented & importantly is a signed script that is published to the gallery, as an output from this repo as to reduce the need for others to have to produce the same script in their own organisations. But that means it needs additional work to achieve.
I've previously asked for scripts in this repo to be signed where possible which was entirely because of this script.
Note Jeff Hicks (@jdhitsolutions) has this repo & module released on the Gallery - https://github.com/jdhitsolutions/PSReleaseTools - It however does not deal with either LTS or being able to provide a specific version to install.
I was in process of updating it in Update install-powershell.ps1 with more options #19884 but due to how long that PR had been in flux (it having been opened over 1 year, 9 months ago) I recently abandoned that PR, especially as there's been a long standing missing daily build as being discussed in daily builds no longer supported / built? #24566
-Dailyfrominstall-powershell.ps1since it no longer exists #25124 unless that gets merged first which it looks like it will & was why I abandoned the PR.rhubarb-geek-nz
They do call out
The installation commands in this article are for the latest stable release of PowerShell. To install a different version of PowerShell, adjust the command to match the version you need.whichNot true, Winget has an explicit --version / -v parameter that can be used to install any previous version of the
Microsoft.PowerShellPackage which also includes all LTS versions under theMicrosoft.PowerShellID code in winget (which are any 7.even.x release that is not marked as a preview release)I believe that this is also partly why 237dmitry none of the windows assets are named with
lts& is in some ways also because PowerShell is internally seen to Windows using the same product-id & how the LTS/Stable releases are installed inC:\Program Files\PowerShell\7\whereas the preview is installed inC:\Program Files\PowerShell\7-preview\& that an upgrade from LTS -> Stable isn't something that the team wanted to do automatically for you if you had opted into Microsoft Update, as that will only update from Current LTS verison to LTS +1, so from7.4.7to what likely is going to be7.4.10& not to the7.5.0branch of releases.This is for me the right way forward as moving from LTS to STS should be informed decision to do so and helps to enable phased roll outs across individuals/organisations & is controlled by the documented environment vairiable for the update notfication behaviour
It also allows for an easy mechanism for the move from one LTS Major version to another, like from 7.2.x to 7.4.x that happened earlier on this year.
It also allows the move from LTS to STS and back as needed. Or so is my understanding
So to install the LTS you need to call it as such
winget install --id Microsoft.PowerShell -v 7.4.7.0They are different tools doing different albeit similar things & managed by 2 different teams from 2 very different areas at Microsoft which to me means it's very very unlikely that alignment in functionality will happen, bar the bits I've mentioned above however can some of the design of that script be
jman (@jman61) - whilst unsupported the below sample code (I tested earlier against a Windows Sandbox) based on the blog post I authored above & the PR I abandoned would allow you to do a single machine, interactive quiet install using the MSI but doesn't have all the flags that the MSI has had added in all this time as I mentioned in 2)
If Steve Lee (@SteveL-MSFT) gives the ok for this script to be extended like I've suggested and then can be released as as signed script which is then published as it's own artifact and pushed to the gallery then I'll happily find the time to work on it either next week or the week after with any members of the team as needed to make sure that we get all the current needed features and that any possible future updates that may be needed to the script are also added in a timely manner like if there were any new additions like MSI flags etc.
It is the PSSummit next week, so perhaps conversations there may help around all the above.
Oh and an interesting additional area I found over the years included that you can also by using these RegKeys ask Microsoft Update to actually install PowerShell & then update it for you (not that it's well known) you can then preset all the regkeys the MSI installer would set up post install to keep the install configuration consistent between installs - this is most of what configuration options are currently missing in the install-powershell.ps1 script in its current form but would be included if Steve Lee (@SteveL-MSFT) gives the ok to do so unless there is anything coming soon enough that should make this work unnecessary like the teams ask in this discussion
The above should help you understand the additional mechanisms that aren't documented as supported, though I think they should be documented as supported going forward, but that's for the team to decide.
That was fun to test out and writeup and quite the trip down memory lane too & I hope is useful to all that read it & all the links.
jman61 commentedon Apr 5, 2025
Hello all - my first github powershell post - very cool discussion, I had a feeling this had been addressed before, didn't see it.
My goals with this request was to lessen "chasing upgrades" for a production setting, and go for a long-term-support model that I saw in the github site and elsewhere. I need automation, not manual process for this, so I'll rethink my approach.
Responses to the comments in the order I remember them:
Thanks all for the feedback and info. - jman