winget tries to install new powershell but the version is already installed
Brief description of your issue

powershell 7.3.4 is already installed but winget thinks it is PS7.3.2
Steps to reproduce
winget upgrade --all
Expected behavior
Identify correct version of software
Actual behavior
misreading PS version #
Environment
C:\Users\denni>winget --info
Windows Package Manager v1.3.2091
Copyright (c) Microsoft Corporation. All rights reserved.
Windows: Windows.Desktop v10.0.19045.2846
System Architecture: X64
Package: Microsoft.DesktopAppInstaller v1.18.2091.0
Logs: %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\DiagOutputDir
Links
---------------------------------------------------------------------------
Privacy Statement https://aka.ms/winget-privacy
License Agreement https://aka.ms/winget-license
Third Party Notices https://aka.ms/winget-3rdPartyNotice
Homepage https://aka.ms/winget
Windows Store Terms https://www.microsoft.com/en-us/storedocs/terms-of-sale
Can you share the output from winget list powershell?
I'm curious what versions are reported.
@denelon I have a similar issue except with the latest PowerShell Preview.
winget list powershell
Name Id Version Available Source
------------------------------------------------------------------------------------------
PowerShell 7-x64 Microsoft.PowerShell 7.3.4.0 winget
PowerShell 7-preview-x64 Microsoft.PowerShell.Preview > 7.3.8.0 7.4.0.2 winget
I have PowerShell 7.4-preview2 installed but winget doesn't seem to understand that. My guess is winget is confused by remnants of a previous update via Windows Update. I mistakenly enabled the Update via Windows Updates bits only to find out Windows Update updates PowerShell via a 32bit setup.exe instead of a .msi file. Thoughts?
@gwojan The PowerShell Preview issue is different and being tracked in
- https://github.com/microsoft/winget-pkgs/issues/105683
Same issue:

But from VS Code:

Solved it. Changed my shortcut to "C:\Program Files\PowerShell\7\pwsh.exe"
@pleabargain this issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 7 days. It will be closed if no further activity occurs within 7 days of this comment.
Winget apparently can't even get to the other installs due to c++ bug interfering!

Still show that PS needs to upgrade.
here's the output for winget list powershell
I can't seem to uninstall the old powershell either:
@pleabargain Looks like you have two versions of PowerShell installed side-by-side and WinGet still has some work to do on how to handle those properly (https://github.com/microsoft/winget-cli/issues/2129). For now, you'll have to manually uninstall PowerShell 7.3.2.0-x64 from appwiz.cpl (or Apps&Features)
[Policy] Side-By-Side
We've been working on the side-by-side scenarios. You could try the latest release and enable the experimental feature on:
- https://github.com/microsoft/winget-cli/releases/tag/v1.8.924-preview
Please provide feedback at:
- https://github.com/microsoft/winget-cli/discussions/4281
WinGet 1.8 now has better support for side-by-side packages. Is this problem still happening?
Hello @pleabargain,
This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 7 days. It will be closed if no further activity occurs within 7 days of this comment.
Template: msftbot/noRecentActivity