Powershell remove app package (Remove-AppxPackage -Allusers) gives error

LangsGalgEnRad 21 Reputation points
2020-08-12T16:38:22.477+00:00

Hello I am trying to uninstall some windows apps by using PowerShell however I am bumping into an error when I use a specific parameter.

I start a new PowerShell prompt as administrator and type:

Get-AppxPackage | Where-Object {$_.PackageFullName -like "*solitaire*"} | Remove-AppxPackage -Allusers  

This results in the following error output:
17253-error.png

When I run the exact same command only without the -Allusers parameter. The removal is successful
17263-succes.png

The app is gone.

Why does specific parameter raise an error? Does somebody know?

Powershell: 5.1.19041.1
Windows 10 Pro

Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,580 questions
0 comments No comments
{count} votes

Accepted answer
  1. 2020-08-13T01:33:27.11+00:00

    According to the help document of REMOVE-APPXPACKAGE, I inquired about the explanation of the parameter -ALLUSERS.
    According to the help document, "This cmdlet works off the parent package type. If it is a bundle, use -PackageTypeFilter and specify the bundle. To use this parameter, you must run the command by using administrator permissions."
    I think yours The application package may meet one of the above two conditions, or you are not logged in using administrator permissions.
    If you have any new concerns, please contact us.


2 additional answers

Sort by: Most helpful
  1. Rob Nicholson 66 Reputation points
    2020-08-28T09:15:14.037+00:00

    This is a breaking change in Windows v2004 - thanks Microsoft....

    0 comments No comments

  2. Ken Jones 1 Reputation point
    2022-02-10T17:35:16.727+00:00

    new PowerShell prompt as administrator

    Missing one -Allusers
    To list installed packages Get-appxpackage

    example to get remove one package

    Get-appxpackage -PackageTypeFilter Main, Bundle, Resource -Allusers Mixed| Remove-AppxPackage -AllUsers

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.