Skip to content
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

[Won't update]: Microsoft.PowerShell #150353

Closed
2 tasks done
wolf99 opened this issue Apr 21, 2024 · 11 comments
Closed
2 tasks done

[Won't update]: Microsoft.PowerShell #150353

wolf99 opened this issue Apr 21, 2024 · 11 comments
Labels
Issue-Bug It either shouldn't be doing this or needs an investigation.

Comments

@wolf99
Copy link

wolf99 commented Apr 21, 2024

Please confirm these before moving forward

  • I have searched for my issue and not found a work-in-progress/duplicate/resolved issue.
  • I have not been informed if the issue is resolved in a preview version of the winget client.

Category of the issue

No applicable update found.

Brief description of your issue

winget update shows that Microsoft.PowerShell is behind (7.4.1.0) the latest release (7.4.2.0)
winget update Microsoft.PowerShell thinks there is not newer release.

THe PowerShell repo does show the newer release: https://github.com/PowerShell/PowerShell/releases/tag/v7.4.2

Steps to reproduce

PS C:\> winget update --id Microsoft.Powershell --source winget
No installed package found matching input criteria.
PS C:\> winget update
Name                            Id                            Version       Available     Source
------------------------------------------------------------------------------------------------
Google Chrome                   Google.Chrome.EXE             124.0.6367.60 124.0.6367.61 winget
Microsoft Edge WebView2 Runtime Microsoft.EdgeWebView2Runtime 123.0.2420.97 124.0.2478.51 winget
PowerShell 7.4.1.0-x64          Microsoft.PowerShell          7.4.1.0       7.4.2.0       winget
3 upgrades available.
PS C:\> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      7.4.1
PSEdition                      Core
GitCommitId                    7.4.1
OS                             Microsoft Windows 10.0.22631
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

PS C:\> winget update PowerShell
No available upgrade found.
No newer package versions are available from the configured sources.

Actual behavior

PowerShell is not updated

Expected behavior

PowerShell is updated

Environment

PS C:\> winget --version
v1.8.924-preview

PS C:\> winget --info
Windows Package Manager (Preview) v1.8.924-preview
Copyright (c) Microsoft Corporation. All rights reserved.

Windows: Windows.Desktop v10.0.22631.3447
System Architecture: X64
Package: Microsoft.DesktopAppInstaller v1.23.924.0

Screenshots and Logs

image

@wolf99 wolf99 added the Issue-Bug It either shouldn't be doing this or needs an investigation. label Apr 21, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs-Triage This work item needs to be triaged by a member of the core team. label Apr 21, 2024
@R-Adrian
Copy link

R-Adrian commented Apr 21, 2024

are you...trying to update PowerShell while running the powershell version that is supposed to be removed & updated?
that's like trying to shoot your own foot and windows is preventing that.
If the old powershell was in use the upgrade was probably scheduled for the next system reboot - the old powershell will only be replaced then. So, reboot the system and check the version then.

@SpecterShell
Copy link
Contributor

Probably due to #127283 (comment)

@wolf99
Copy link
Author

wolf99 commented Apr 21, 2024

are you...trying to update PowerShell while running the powershell version that is supposed to be removed & updated?
that's like trying to shoot your own foot and windows is preventing that.
If the old powershell was in use the upgrade was probably scheduled for the next system reboot - the old powershell will only be replaced then. So, reboot the system and check the version then.

I tried this from other shells also.
For the sample I put here I used ms PowerShell so that I could properly show the verilsion output from PowerShell itself, as kind of a source of version information independent of winget.

Again, same behaviour in CMD or windows powershell as in ms PowerShell.

Even if this is the cause, I would expect that winget, as an independent tool,would still be able to consistently recognise the versions, but that the update installer would then fail (kind of like if you try to delete a file that is already open). In this case, winget doesn't seem to even understand that the system has an old version even though it has just there is a newer version available.

@wolf99
Copy link
Author

wolf99 commented Apr 21, 2024

Probably due to #127283 (comment)

Wow. Just skimming through the linked issue that also links to another issue and so on, it seems that, essentially, winget gets confused between all the different packages named "powershell"...

Who could have possibly predicted problems with naming different packages with the same name...🤦

@stephengillie
Copy link
Collaborator

Yes - with a diversity of installer types and CPU architectures, some software packages have a handful of installers. Add language localization, and some of Mozilla's manifests have more than 100 installers listed.

The package manager logic downloads the repo's contents inside an MSIX, and compares this to the Registry, returning matching results. Not just on name, but many manifests also utilize DisplayCode and InstallerCode to help with matching and correlation.

Sometimes, a dupicate registry entry can cause issues. Could you run winget list powershell and paste the output?

@microsoft-github-policy-service microsoft-github-policy-service bot removed the Needs-Triage This work item needs to be triaged by a member of the core team. label Apr 22, 2024
@wolf99
Copy link
Author

wolf99 commented Apr 22, 2024

Hi @stephengillie

Here is the output:

PS C:\> winget list powershell
Name                   Id                        Version      Available Source
------------------------------------------------------------------------------
PowerShell 7.4.1.0-x64 Microsoft.PowerShell      7.4.1.0      7.4.2.0   winget
Windows Terminal       Microsoft.WindowsTerminal 1.19.10821.0           winget

@wolf99
Copy link
Author

wolf99 commented Apr 22, 2024

The input from @R-Adriangot got me thinking a little, so I tried checking the PSVersion Table from cmd prompt.

c:\>PowerShell $PSVersionTable

Name                           Value
----                           -----
PSVersion                      5.1.22621.2506
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.22621.2506
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

So perhaps the "system" (i.e. Windows and winget combined) somehow only sees the Windows powershell and not Microsoft PowerShell.

Of course I could update PowerShell by just downloading the relevant MSI installer... but this is a problem with winget (or perhaps Windws) that maybe should be fixed

@stephengillie
Copy link
Collaborator

stephengillie commented Apr 22, 2024

The 1.0 version is sometimes called Windows Powershell, such as in Terminal:
image
And this version stores data at C:\Program Files (x86)\WindowsPowerShell instead of C:\Program Files\PowerShell. It's possible that this 1.0 version is running when the version 7 is upgrading.

Please don't conflate separate software into one - it confuses troubleshooting. The package manager mostly matches a data file to the Registry to return results, and runs the installer programs. What's occurring here seems to be a mismatch between the data in the PC's Registry with the data from the repo. From your reports and pasted outputs, I believe this PC's Windows OS to generally be in normal working order. (Edit: accidentally submitted before complete.)

Probably the best course here is to reinstall PowerShell - the package manager has this version so should be able to winget uninstall Microsoft.Powershell followed by a quick winget install Microsoft.Powershell. The automation of this manual process has apparently been added to a planning system, but other work might be prioritized ahead of it.

@wolf99
Copy link
Author

wolf99 commented Apr 22, 2024

Hmm:

c:\>winget uninstall Microsoft.PowerShell
No installed package found matching input criteria.

@stephengillie
Copy link
Collaborator

This is beyond my current knowledge of the system. I do not currently know what state the Registry could be in, which would give the outputs pasted in this Issue.

@wolf99
Copy link
Author

wolf99 commented May 10, 2024

Well, looks like Windows took care of this itself somehow while I wasn't looking.
Not sure if it was Windows Update or Microsoft Store, but Powershell now shows 7.4.2 and Im very sure it wasn't via winget.
🤷‍♂️

Thanks for th help anyway @stephengillie !

@wolf99 wolf99 closed this as completed May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Bug It either shouldn't be doing this or needs an investigation.
Projects
None yet
Development

No branches or pull requests

4 participants