Skip to content

Can't uninstall Powershell #4140

Closed
Closed

Description

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

Activity

  1. changed the title [-]Can uninstall Powershell[/-] [+]Can't uninstall Powershell[/+] on Feb 4, 2024
  2. mdanish-kh commented on Feb 5, 2024

    @mdanish-kh
    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

  3. added
    Area-External
    and removed
    Needs-Triage
    on Feb 5, 2024
  4. added
    Issue-Bug
    Command-Uninstall
    Area-Matching
    Side-by-Side
    on Feb 5, 2024
  5. denelon commented on Apr 2, 2024

    @denelon
    Collaborator

    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:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-ExternalArea-MatchingCommand-UninstallIssue-BugSide-by-Side

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions