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

LangsGalgEnRad 21 Reputation points

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:

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

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,344 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 61 Reputation points

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

    0 comments No comments

  2. Ken Jones 1 Reputation point

    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