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
PowerShell-Release : --tag v7.4.5 --version 7.4.5.0 is not upgrading or installing via winget from --source winget. Note: I am on PowerShell Core 7.4.4 #24237
PS> winget find --id Microsoft.PowerShell -s winget #<should find --id Microsoft.PowerShell -s winget --version 7.4.5.0>PS> winget upgrade --id Microsoft.PowerShell -s winget#<should upgrade --id Microsoft.PowerShell -s winget to --version 7.4.5.0>Expected: Latest Release version of PowerShell (--tag v7.4.5) (--e v7.4.5.0) would upgrade the existing installed version (--version 7.4.4.0).
Actual behavior
PS> winget upgrade --id Microsoft.PowerShell -s winget #<the latest version should be defaulted to>PS> No available upgrade found.PS> No newer package versiona are available from the configured sources.Actual: PS> winget find --id Microsoft.PowerShell -s winget -v 7.4.5.0 #<DOES Find --id Microsoft.PowerShell -s winget -v 7.4.5.0 >PS> winget upgrade --id Microsoft.PowerShell -s winget #<DOES NOT Find --id Microsoft.PowerShell -s winget -v 7.4.5.0>#<ERRORS WITH: PS> No available upgrade found.PS> No newer package versiona are available from the configured sources.
>
Error details
Get-Error returns Nothing.
Environment data
$PSVersionTable
Name Value
---------
PSVersion 7.4.4
PSEdition Core
GitCommitId 7.4.4
OS Microsoft Windows 10.0.19045
Platform Win32NT
PSCompatibleVersions {1.0,2.0,3.0,4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
This was a fun one to dig into & I'm pretty certain I have managed to understand and I believe replicate what has been happening for iCanHazConfetti in this issue as well as in #23970 & in #24111
There is a possibility this behaviour may continue to happen for future releases, however, I do think that this can be avoided for others but likely needs a change in how Microsoft Update Installs the preview version and actually correctly identifies it as the preview package not the stable package.
Key points
Stable and Preview versions have been installed either via winget or other means & then crucially have not been updated by winget but most likely been updated by Microsoft Update
When Microsoft Update runs
Preview version 7.5.1.0 gets "upgraded" to a newly installed Package Name of PowerShell 7.5.2.0-x64
winget sees these "upgrades" as a Microsoft.PowerShell package & not Microsoft.PowerShell.Preview package
Stable version 7.4.2 gets "upgraded to a newly installed Package Name of PowerShell 7.4.3.0-x64
winget sees these "upgrades" as a Microsoft.PowerShell package as expected
The conflict here in what winget sees is why winget upgrade does not work
I think the only fix here for iCanHazConfetti is to get winget is to force a fresh install by not using winget upgrade here & optionally attempt to uninstall previous versions too
if installed by winget then we should decide whether or not to allow microsoft update installs & if we do then it needs to be sure that winget will see the correct ID for either - Q for Steve Lee (@SteveL-MSFT) & Demitrius Nelon (@denelon) to dig into, I personally think that if installed via winget it's being managed by winget and not Microsoft Update but there is benefit in having fallback on Microsoft Update if a user doesn't run winget upgrade
preview releases aren't installed by Microsoft Update as PowerShell Preview - 7.5.0.4 which is a potential bug - confirmed by downloading and installing the update package from Microsoft Update Catalog
Example being that 7.5.0-preview2 is installed as PowerShell 7.5.2.0-x64
missing metadata for v7.4.3 in the update catalog too
Notes
I noticed that you have a 7.4x (stable) and 7.5x (preview) versions on your machine & an older 7.3.8 install from an image that you shared in this #24111 (comment)
In my testing it looks to me that both 7.3.x and 7.5.x (no matter how they'd been installed) had been updated via Microsoft Update. I noticed this as the version numbers are returned as part of the Name via winget list --id Microsoft.PowerShell which I have seen on a number of my machines when it is allowed to be updated by Microsoft Update.
I then noticed that when you install PowerShell via winget, which I did across multiple machines & sandboxes to be sure, the name of the package returned by winget is as follows
If you install the update package for 7.5.0-preview.2 winget will incorrectly ID it as not being the Microsoft.PowerShell.Preview package - which is a bug Steve Lee (@SteveL-MSFT) that I don't know where this needs raised to be fixed
The writeup on this would not have taken so long if I wasn't having issues with my laptop & thankfully my comments here in GitHub between reboots and shutdowns where saved & not lost
Reacted by Steve Lee, Grigory, ericbyrd, Abhinav Singh and ABingham-HNTB
This was a fun one to dig into & I'm pretty certain I have managed to understand and I believe replicate what has been happening for iCanHazConfetti in this issue as well as in #23970 & in #24111 There is a possibility this behaviour may continue to happen for future releases, however, I do think that this can be avoided for others but likely needs a change in how Microsoft Update Installs the preview version and actually correctly identifies it as the preview package not the stable package.
Key points
Stable and Preview versions have been installed either via winget or other means & then crucially have not been updated by winget but most likely been updated by Microsoft Update
When Microsoft Update runs
Preview version 7.5.1.0 gets "upgraded" to a newly installed Package Name of PowerShell 7.5.2.0-x64
winget sees these "upgrades" as a Microsoft.PowerShell package & not Microsoft.PowerShell.Preview package
Stable version 7.4.2 gets "upgraded to a newly installed Package Name of PowerShell 7.4.3.0-x64
winget sees these "upgrades" as a Microsoft.PowerShell package as expected
The conflict here in what winget sees is why winget upgrade does not work
I think the only fix here for iCanHazConfetti is to get winget is to force a fresh install by not using winget upgrade here & optionally attempt to uninstall previous versions too
if installed by winget then we should decide whether or not to allow microsoft update installs & if we do then it needs to be sure that winget will see the correct ID for either - Q for Steve Lee (@SteveL-MSFT) & Demitrius Nelon (@denelon) to dig into, I personally think that if installed via winget it's being managed by winget and not Microsoft Update but there is benefit in having fallback on Microsoft Update if a user doesn't run winget upgrade
preview releases aren't installed by Microsoft Update as PowerShell Preview - 7.5.0.4 which is a potential bug - confirmed by downloading and installing the update package from Microsoft Update Catalog
Example being that 7.5.0-preview2 is installed as PowerShell 7.5.2.0-x64
missing metadata for v7.4.3 in the update catalog too
Notes
I noticed that you have a 7.4x (stable) and 7.5x (preview) versions on your machine & an older 7.3.8 install from an image that you shared in this #24111 (comment) In my testing it looks to me that both 7.3.x and 7.5.x (no matter how they'd been installed) had been updated via Microsoft Update. I noticed this as the version numbers are returned as part of the Name via winget list --id Microsoft.PowerShell which I have seen on a number of my machines when it is allowed to be updated by Microsoft Update.
I then noticed that when you install PowerShell via winget, which I did across multiple machines & sandboxes to be sure, the name of the package returned by winget is as follows
If you install the update package for 7.5.0-preview.2 winget will incorrectly ID it as not being the Microsoft.PowerShell.Preview package - which is a bug Steve Lee (@SteveL-MSFT) that I don't know where this needs raised to be fixed
The writeup on this would not have taken so long if I wasn't having issues with my laptop & thankfully my comments here in GitHub between reboots and shutdowns where saved & not lost
Activity
kilasuit commentedon Aug 31, 2024
kilasuit commentedon Aug 31, 2024
accidental keyboard combo closed it
kilasuit commentedon Sep 10, 2024
This was a fun one to dig into & I'm pretty certain I have managed to understand and I believe replicate what has been happening for iCanHazConfetti in this issue as well as in #23970 & in #24111
There is a possibility this behaviour may continue to happen for future releases, however, I do think that this can be avoided for others but likely needs a change in how Microsoft Update Installs the preview version and actually correctly identifies it as the preview package not the stable package.
Key points
7.5.1.0gets "upgraded" to a newly installed Package Name ofPowerShell 7.5.2.0-x64Microsoft.PowerShellpackage & notMicrosoft.PowerShell.PreviewpackagePowerShell 7.4.3.0-x64Microsoft.PowerShellpackage as expectedThe conflict here in what winget sees is why winget upgrade does not work
I think the only fix here for iCanHazConfetti is to get winget is to force a fresh install by not using
winget upgradehere & optionally attempt to uninstall previous versions toowinget install --id Microsoft.PowerShell -s winget -v 7.4.5.0 --uninstall-previous --force7.3.8.0if not then runningwinget uninstall --id Microsoft.PowerShell -v 7.3.8.0should do itwinget install --id Microsoft.PowerShell.Preview -s winget -v 7.5.0.4 --uninstall-previous --forcePain points in investigating
PowerShell Preview - 7.5.0.4which is a potential bug - confirmed by downloading and installing the update package from Microsoft Update CatalogNotes
I noticed that you have a 7.4x (stable) and 7.5x (preview) versions on your machine & an older 7.3.8 install from an image that you shared in this #24111 (comment)
In my testing it looks to me that both 7.3.x and 7.5.x (no matter how they'd been installed) had been updated via Microsoft Update. I noticed this as the version numbers are returned as part of the Name via
winget list --id Microsoft.PowerShellwhich I have seen on a number of my machines when it is allowed to be updated by Microsoft Update.I then noticed that when you install PowerShell via winget, which I did across multiple machines & sandboxes to be sure, the name of the package returned by winget is as follows

If you install the update package for 7.5.0-preview.2 winget will incorrectly ID it as not being the Microsoft.PowerShell.Preview package - which is a bug Steve Lee (@SteveL-MSFT) that I don't know where this needs raised to be fixed

The writeup on this would not have taken so long if I wasn't having issues with my laptop & thankfully my comments here in GitHub between reboots and shutdowns where saved & not lost
iCanHazConfetti commentedon Sep 16, 2024
THESE COMMANDS WORKED :
PowerShell Stable Release :
PS> winget install --id Microsoft.PowerShell -s winget -v 7.4.5.0 --uninstall-previous --force
This should remove the lingering old version 7.3.8.0
<IT DID, THIS DID WORK ON MY MACHINE>
if not then running winget uninstall --id Microsoft.PowerShell -v 7.3.8.0 should do it
PowerShell Preview Release :
PS> winget install --id Microsoft.PowerShell.Preview -s winget -v 7.5.0.4 --uninstall-previous --force
This should remove the lingering old version 7.5.0.-preview.2
<IT DID, THIS WORKED ON MY MACHINE>
if not then running winget uninstall --id Microsoft.PowerShell -v 7.3.8.0 should do it
-- iCanHazConfetti
microsoft-github-policy-service commentedon Oct 25, 2024
This issue has been marked as external and has not had any activity for 1 day. It has been be closed for housekeeping purposes.
microsoft-github-policy-service commentedon Oct 25, 2024
This issue has been marked as answered and has not had any activity for 1 day. It has been closed for housekeeping purposes.
microsoft-github-policy-service commentedon Oct 25, 2024
📣 Hey iCanHazConfetti, how did we do? We would love to hear your feedback with the link below! 🗣️
🔗 https://aka.ms/PSRepoFeedback