Skip to content

Microsoft.PowerShell upgrade installs MSIX side-by-side instead of upgrading existing MSI installation #6333

Description

@philenosborne

Relevant area(s)

WinGet CLI

Relevant command(s)

winget upgrade

Brief description of your issue

I searched existing issues for:

  • Microsoft.PowerShell MSI MSIX
  • "No installed package found matching input criteria"
  • "No applicable installer found"
  • PowerShell msix side-by-side
    but I could not find an existing issue matching this behavior.

Winget detects my existing PowerShell installation and reports that an upgrade is available, but it cannot upgrade it.

Instead, running winget install --force installs the MSIX version side-by-side while leaving the existing MSI installation untouched.

Steps to reproduce

I started with an existing machine-wide MSI installation of PowerShell located at:
C:\Program Files\PowerShell\7\pwsh.exe

The active PowerShell version was verified with:
$PSVersionTable.PSVersion
Get-Command pwsh | Select-Object Source

Result:
Version: 7.5.5
Source: C:\Program Files\PowerShell\7\pwsh.exe

I then updated winget sources:
winget source update

Then I listed installed PowerShell packages:

winget list PowerShell

Winget detected the existing PowerShell installation and reported that an upgrade was available:
Name Id Version Available Source

PowerShell 7.5.5.0-x64 Microsoft.PowerShell 7.5.5.0 7.6.2.0 winget

I then tried to upgrade PowerShell directly by package id:
winget upgrade --id Microsoft.PowerShell --exact

Result:
No installed package found matching input criteria.

I also tried:
winget upgrade Microsoft.PowerShell

Result:
No installed package found matching input criteria.

Then I tried upgrading all available packages:
winget upgrade --all

Winget listed PowerShell as upgradeable:
Name Id Version Available Source

PowerShell 7.5.5.0-x64 Microsoft.PowerShell 7.5.5.0 7.6.2.0 winget

However, the existing MSI installation was not upgraded.

I then checked the package manifest:
winget show --id Microsoft.PowerShell

This showed that the available installer type was MSIX:
Installer Type: msix

I then tried forcing installation:
winget install --id Microsoft.PowerShell --source winget --force

Winget reported:
Successfully installed

After restarting PowerShell, I verified the active version and path again:
$PSVersionTable.PSVersion
Get-Command pwsh | Select-Object Source

The active installation was still unchanged:
Version: 7.5.5
Source: C:\Program Files\PowerShell\7\pwsh.exe

I also checked the file version and timestamps under the existing installation directory:
(Get-Item "C:\Program Files\PowerShell\7\pwsh.exe").VersionInfo | Select-Object ProductVersion,FileVersion
Get-ChildItem "C:\Program Files\PowerShell\7"

The existing installation still had version 7.5.5, and the files had not been modified.

I then checked whether an AppX/MSIX package had been installed:
Get-AppxPackage Microsoft.PowerShell

This showed that winget had installed the MSIX package side-by-side:
Name : Microsoft.PowerShell
Version : 7.6.2.0
InstallLocation : C:\Program Files\WindowsApps\Microsoft.PowerShell_7.6.2.0_x64__8wekyb3d8bbwe

I then checked all pwsh commands available:
Get-Command pwsh -All

This showed two PowerShell entries:
C:\Program Files\PowerShell\7\pwsh.exe
C:\Users<user>\AppData\Local\Microsoft\WindowsApps\pwsh.exe

The first one was the existing MSI installation, still at 7.5.5. The second one was the MSIX/App Execution Alias entry.

I removed the MSIX package:
Get-AppxPackage Microsoft.PowerShell | Remove-AppxPackage

After that, only the original MSI-based PowerShell installation remained.

Finally, I tried to force winget to use an MSI installer:
winget install --id Microsoft.PowerShell --source winget --installer-type msi --scope machine --force

Result:
No applicable installer found; see logs for more details.

This suggests that winget can detect the existing MSI installation and can see that an update is available, but the currently available manifest only provides an MSIX installer. As a result, winget cannot upgrade the existing MSI installation, and winget install --force installs the MSIX package side-by-side instead of upgrading the existing installation.

Expected behavior

Winget should either upgrade the existing machine-wide MSI installation of PowerShell, or clearly report that no applicable upgrade path exists from the installed MSI package to the currently available MSIX package.

It should not report a successful installation while leaving the existing MSI installation untouched and installing an MSIX package side-by-side.

Actual behavior

Winget detects the existing MSI installation and reports that an update is available.

However, upgrading by package id fails with:
No installed package found matching input criteria.

Running:
winget install --id Microsoft.PowerShell --source winget --force

reports success, but does not update the existing installation in:
C:\Program Files\PowerShell\7\pwsh.exe

Instead, it installs the MSIX package side-by-side under:
C:\Program Files\WindowsApps\Microsoft.PowerShell_7.6.2.0_x64__8wekyb3d8bbwe

This results in two PowerShell installations and leaves the active MSI-based shell unchanged.

Environment

Windows Package Manager v1.28.240
Windows Desktop v10.0.26200.8655
Micrsoft.DesktopAppInstaller v1.28.240.0
PowerShell 7.5.5
Existing PowerShell path: C:\Program Files\PowerShell\7\pwsh.exe
Existing installation type: MSI / machine-wide
Available winget package version: 7.6.2.0
Winget package id: Microsoft.PowerShell

Additional context:
PowerShell is configured as the Windows shell instead of Explorer on this system. Therefore a deterministic machine-wide installation path is important, and installing the MSIX package side-by-side is not an acceptable replacement for upgrading the existing MSI installation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Command-UpgradeIssue related to WinGet UpgradeIssue-BugIt either shouldn't be doing this or needs an investigation.Needs-TriageIssue needs to be triaged

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions