question

LangsGalgEnRad-6524 avatar image
0 Votes"
LangsGalgEnRad-6524 asked KenJones-8332 answered

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

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
error.png (25.4 KiB)
succes.png (8.3 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

YoungYang-MSFT avatar image
0 Votes"
YoungYang-MSFT answered LangsGalgEnRad-6524 commented

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.

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Yes I read that as well. Just was not sure how to implement it, but found my way about it.

 Get-AppxPackage -PackageTypeFilter Main, Bundle, Resource | Where-Object {$_.PackageFullName -like "*solitaire*"}  | Remove-AppxPackage -Allusers

Works, thanks :-)

0 Votes 0 ·
RobNicholson-1457 avatar image
0 Votes"
RobNicholson-1457 answered

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

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

KenJones-8332 avatar image
0 Votes"
KenJones-8332 answered

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

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.