microsoft / winget-cli

WinGet is the Windows Package Manager. This project includes a CLI (Command Line Interface), PowerShell modules, and a COM (Component Object Model) API (Application Programming Interface).
https://learn.microsoft.com/windows/package-manager/
MIT License
23.37k stars 1.45k forks source link

PowerShell upgrades from 7.4.5.0 MSI to 7.4.6.0 does not work #4918

Open Karl-WE opened 1 month ago

Karl-WE commented 1 month ago

Brief description of your issue

winget upgrade Microsoft.PowerShell
winget upgrade --exact Microsoft.PowerShell
winget upgrade --exact --id Microsoft.PowerShell
winget upgrade --id Microsoft.PowerShell

will unexpectedly result into "No installed package found matching input criteria."

Steps to reproduce

Use Windows Server vNext b26308 (might also affect other OS) Install PowerShell 7.4.5 via MSI (winget or directly)

winget upgrade --all

Image

or

winget upgrade Microsoft.PowerShell

Image

or

winget upgrade --exact Microsoft.PowerShell

Image

or

winget upgrade --id Microsoft.PowerShell

Image

or

winget upgrade --exact --id Microsoft.PowerShell

Image

Logs

WinGet-2024-10-28-22-20-41.233.zip

Expected behavior

as winget upgrade would indicate there's a package 7.4.6, I expect it should upgrade to this version.

Actual behavior

Error

No installed package found matching input criteria.

Possible workaround: winget install microsoft.powershell does fetch the package correctly.

--exact or --id does not need to be specified Image

Environment

Windows: Windows.Server v10.0.26304.5000 System Architecture: X64 Package: Microsoft.DesktopAppInstaller v1.24.2411.0 v1.9.2411-preview

any other software: nothing special, very clean Windows Server Insider OS for testing purposes. running winget from Microsoft Terminal in PShell 7.4.5 session

Existing PowerShell IS MSI package Image

Karl-WE commented 1 month ago

eventually remote related to #4908 (as per discussion with @denelon)

Karl-WE commented 1 month ago

with further testing can confirm that

winget install Microsoft.PowerShell

would result into the same error as mentioned in 4908 linked above Image

Noteably and irritating though output from Settings > Installed Apps

Image

Karl-WE commented 1 month ago

When I uninstalled both, each were MSI files. No idea how this happened that they "appear" installed side-by-side.

Theory: The PS7 package got upgraded through Windows Update (MSInstaller icon) while native MSI has the nice PS7 shell icon?

Ideas? @SteveL-MSFT @daxian-dbw on the side-by-side situation? I could bet I never installed two MSI or even a combination of EXE and MSI. This is a clean Windows Server for Hyper-V testing only.

latest logs:

WinGet-2024-10-29-01-50-56.154.log WinGet-Microsoft.PowerShell.7.4.6.0-2024-10-29-01-51-09.428.log

Paciupa commented 1 month ago

I've faced with the same bug on the desktop (Win10 10.0.19045.5011, winget 1.9.25180) and on the laptop (Win11 10.0.22631.4317, winget 1.9.25180).

winget list --upgrade-available --include-unknown or winget list --name PowerShell show: PowerShell 7.4.5.0-x64 Microsoft.PowerShell 7.4.5.0 7.4.6.0 winget.

But winget upgrade PowerShell or winget upgrade --name PowerShell return Доступные обновления не найдены. Более новые версии пакетов недоступны в настроенных источниках.

And winget upgrade PowerShell --source winget or winget upgrade --name PowerShell --source winget or winget list --id Microsoft.PowerShell or winget list Microsoft.PowerShell return Не найдены установленные пакеты, соответствующие введенным условиям..

winget source reset --force and winget source update didn't help.

As I understood from logs winget tries to use Microsoft.PowerShell.Preview from winget source or 9MZ1SNWT0N5D from msstore source, but not Microsoft.PowerShell from winget source.

Logs from desktop (Win10): WinGet-2024-10-29-16-05-29.211.log WinGet-2024-10-29-16-05-19.828.log WinGet-2024-10-29-16-04-58.773.log WinGet-2024-10-29-16-04-07.869.log WinGet-2024-10-29-16-03-57.113.log WinGet-2024-10-29-15-47-49.441.log WinGet-2024-10-29-15-46-56.721.log WinGet-2024-10-29-15-46-44.103.log

Logs from laptop (Win11): WinGet-2024-10-29-18-13-35.996.log WinGet-2024-10-29-18-13-24.945.log

Karl-WE commented 4 weeks ago

Thank you for joining and repro on your end.

Karl-WE commented 4 weeks ago

Potentially related #3989