Windows 10 – Remove app packages (.appx) with Powershell from your user account and machine.

There are a few ways to remove packages from Windows 10. While not every method is as easy as another, some might be less or more complete than others, this method seems to work with the current and previous Windows 10 builds and will keep working unless Microsoft makes some drastic changes.

Here is how I do things with a little explanation so that everyone can get the feeling they know what they are doing. 😉

Step 1. Know what you have.

Open PowerShell (preferably as an administrator) and type:

Get-AppxPackage

This will show you a list of Appx packages installed on your user account. You probably wont be able to read it because there is a lot of text. We can fix that. Type:

Get-AppxPackage | Format-Table

Much better readable isn’t it?

You also might want to look for packages of every user account on your pc. To do that type:

Get-AppxPackage -AllUsers | Format-Table

Step 2. Select what you don’t want.

In Step 1 you have seen a lot of output on the screen. You probably don’t want to remove everything so there is a need to filter that list. Here’s how:

Get-AppxPackage -AllUsers | where-object {$_.Publisher -notlike "CN=Microsoft*"} | Format-Table

What I’ve done in the above line is to filter out all the packages that are provided by the Publisher Common Name Microsoft*

If you look at the output you might see that Skype is in the output. While Skype is from Microsoft they decided to use a different publisher name for that package. No problem, we will add another layer of filtering.

Get-AppxPackage -AllUsers | where-object {$_.Publisher -notlike "*Microsoft*"} | where-object {$_.Publisher -notlike "*Skype*"} | Format-Table

With this line everything with the word Skype somewhere in the publisher name will also be filtered out.

You can go ahead and change the filtering of apps you want to delete to your liking before continuing to the next step.

Step 3. Let’s remove what we don’t want.

Step 3 is real easy. We’ll just use that you made in Step 2 and add the remove command.

Get-AppxPackage -AllUsers | where-object {$_.Publisher -notlike "*Microsoft*"} | where-object {$_.Publisher -notlike "*Skype*"} | Remove-AppxPackage
* notice that you have to remove the Format-Table when using Remove-AppxPackage

 

The apps are now gone from the user accounts. BUT maybe not from your PC on machine level. To remove them from your Windows installation we have to do another few tricks.

Optional

Step 4. View what we have in the Windows image.

To remove app packages from a Windows image the command is slightly different. Lets us first view that packages we have.

Get-AppxProvisionedPackage -online | where-object {$_.PackageName -notlike "Microsoft*"} | Format-Table

There is a good chance the list is empty, then you are done for now.

Step 5. Remove from the Windows image we are using.

You might have guessed it already. Replace the Format-Table with the remove command to uninstall the packages.

Get-AppxProvisionedPackage -online | where-object {$_.PackageName -notlike "Microsoft*"} | Remove-AppxProvisionedPackage -online

The removal of packages in the Windows image will also prevent that a new user on your pc is getting the packages by default when they sign in for the first time. This way a new user account will be as clean as it gets (with the exception of making customizations during the deployment phase, but that is a whole other level of tweaking Windows and a bit too much to explain here.)

Feel free to ask your questions in the comments or through the contact form.

Leave a comment