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

Can't uninstall Powershell #4140

Closed
Gavin-Williams opened this issue Feb 4, 2024 · 2 comments
Closed

Can't uninstall Powershell #4140

Gavin-Williams opened this issue Feb 4, 2024 · 2 comments
Labels
Area-External Issue outside of winget-cli source Area-Matching Issue related to correlation between installed package and manifest Command-Uninstall Issue related to WinGet Uninstall Issue-Bug It either shouldn't be doing this or needs an investigation. Side-by-Side Issue related to side by side package installation
Milestone

Comments

@Gavin-Williams
Copy link

Brief description of your issue

Powerwell won't update, and tells me to uninstall existing version. But when I try to uninstall I get an error.

Steps to reproduce

❯ winget list --name Microsoft.Powershell
No installed package found matching input criteria.

❯ winget uninstall --name Microsoft.Powershell
No installed package found matching input criteria.

Expected behavior

I expect to see that powershell is installed and which version. And I expect to then be able to uninstall it.

Actual behavior

Oh dear. What can i say, it's behaving like a hello-world app that just prints out error messages. I'm yet to see winget actually do anything.

Environment

Windows Package Manager v1.6.3482
Copyright (c) Microsoft Corporation. All rights reserved.

Windows: Windows.Desktop v10.0.22631.3085
System Architecture: X64
Package: Microsoft.DesktopAppInstaller v1.21.3482.0

Winget Directories
-----------------------------------------------------------------------------------------------------------------------
Logs                               %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\Diag…
User Settings                      %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\sett…
Portable Links Directory (User)    %LOCALAPPDATA%\Microsoft\WinGet\Links
Portable Links Directory (Machine) C:\Program Files\WinGet\Links
Portable Package Root (User)       %LOCALAPPDATA%\Microsoft\WinGet\Packages
Portable Package Root              C:\Program Files\WinGet\Packages
Portable Package Root (x86)        C:\Program Files (x86)\WinGet\Packages
Installer Downloads                %USERPROFILE%\Downloads

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

Admin Setting                             State
--------------------------------------------------
LocalManifestFiles                        Disabled
BypassCertificatePinningForMicrosoftStore Disabled
InstallerHashOverride                     Disabled
LocalArchiveMalwareScanOverride           Disabled
@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs-Triage Issue need to be triaged label Feb 4, 2024
@Gavin-Williams Gavin-Williams changed the title Can uninstall Powershell Can't uninstall Powershell Feb 4, 2024
@mdanish-kh
Copy link
Contributor

--name filters packages based on the DisplayName string value they write to Registry. That's the name of the package visible in Control Panel / Apps&Features. Microsoft.PowerShell is the unique identifier given to the package in the winget repository, so --id is the filter you're looking for here.

You may find more value in just winget list powershell since that forces the match on many different parameters listed in the manifest (substring match on ID, name, tags, commands etc..).

However, looking at another issue you raised (#4139), I'm guessing you want to unblock the winget install/upgrade Microsoft.PowerShell command. The output of winget list powershell on your machine would give me more context, but I'm assuming you have a side-by-side installation of PowerShell MSIX (installed from MS store) and PowerShell MSI (can be installed through their github releases / through winget). WinGet currently can't reason correctly about side-by-side installations (see #2129). It maps both of the installations to the same PackageId (Microsoft.PowerShell), and gets confused as to which installer type to update. You can either use --force to force winget to bypass the check, or provide exact matching by the DisplayName (since PowerShell MSI and PowerShell MSIX use a different name in Apps&Features).

TLDR


Use either one of these commands:

  • winget upgrade Microsoft.PowerShell --force
  • winget upgrade --name "PowerShell 7-x64" (if you have the 64-bit version)

to bypass the installer type check

@stephengillie stephengillie added Area-External Issue outside of winget-cli source and removed Needs-Triage Issue need to be triaged labels Feb 5, 2024
@denelon denelon added Issue-Bug It either shouldn't be doing this or needs an investigation. Command-Uninstall Issue related to WinGet Uninstall Area-Matching Issue related to correlation between installed package and manifest Side-by-Side Issue related to side by side package installation labels Feb 5, 2024
@denelon
Copy link
Contributor

denelon commented Apr 2, 2024

We've been working on the side-by-side scenarios. You could try the latest release and enable the experimental feature on:

Please provide feedback at:

@denelon denelon added this to the 1.9 Client milestone Jul 3, 2024
@denelon denelon closed this as completed Jul 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-External Issue outside of winget-cli source Area-Matching Issue related to correlation between installed package and manifest Command-Uninstall Issue related to WinGet Uninstall Issue-Bug It either shouldn't be doing this or needs an investigation. Side-by-Side Issue related to side by side package installation
Projects
None yet
Development

No branches or pull requests

4 participants