Windows 10 includes a number of built-in apps ranging from basic apps like Calculator and Weather to more task-focused apps like Mail and Photos. While these built-in apps are fine for most situations, in a business environment, they may be inappropriate, redundant or unsupported. Very often, these apps are my pose a security risk. That’s why, in this post, you’re going to learn how to remove Windows 10 apps with PowerShell.
Not a reader? Watch this related video tutorial!The problem is that Microsoft doesn’t make it easy to uninstall some of these apps. There is no uninstall button when uninstalling using normal methods. The built-in apps must be uninstalled through PowerShell.
Disclaimer: Do not uninstall all the Windows 10 apps. Many of them are needed for the Windows 10 “Experience” and others, like the .NET framework, are needed for other programs. Be picky about which applications to uninstall. You can reinstall all the applications, however, and you will see the PowerShell command to just that at the end of this article
Finding Windows 10 Apps with PowerShell
There are actually two different kinds of applications that we will be working with.
- AppX packages – Applications installed with the operating system
- AppX provisioned packages – Applications installed as part of the user profile first time setup.
The first step is to get an inventory of the apps that are installed. To do that, start PowerShell with elevated privileges and run the command Get-AppxPackage
. This will return all of the AppX packages installed on Windows 10.
PS C:\> Get-AppxPackage
Name : Microsoft.NET.Native.Framework.1.6
Publisher : CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US
Architecture : X64
ResourceId :
Version : 1.6.24903.0
PackageFullName : Microsoft.NET.Native.Framework.1.6_1.6.24903.0_x64__8wekyb3d8bbwe
InstallLocation : C:\Program Files\WindowsApps\Microsoft.NET.Native.Framework.1.6_1.6.24903.0_x64__8wekyb3d8bbwe
IsFramework : True
PackageFamilyName : Microsoft.NET.Native.Framework.1.6_8wekyb3d8bbwe
PublisherId : 8wekyb3d8bbwe
IsResourcePackage : False
IsBundle : False
IsDevelopmentMode : False
IsPartiallyStaged : False
SignatureKind : Store
Status : Ok
--snip--
The provisioned packages have a slightly different command and also need the Online
parameter. The Online
parameter pulls packages from the current online operating system as opposed to an image file located in a local directory. This will present a list of all the details regarding each package.
PS C:\> Get-AppxProvisionedPackage -Online
DisplayName : Microsoft.3DBuilder
Version : 16.1.1431.0
Architecture : neutral
ResourceId : ~
PackageName : Microsoft.3DBuilder_16.1.1431.0_neutral_~_8wekyb3d8bbwe
Regions :
DisplayName : Microsoft.BingWeather
Version : 4.31.11905.0
Architecture : neutral
ResourceId : ~
PackageName : Microsoft.BingWeather_4.31.11905.0_neutral_~_8wekyb3d8bbwe
Regions :
--snip--
Narrowing down the app listings
Both of these commands produce rather verbose listing and all you’re interested in is the Name
of the package for the Appx packages and the DisplayName
for the provisioned packages as shown below.
To make things a little easier, pipe the results through Select-Object
and select the Name
and the DisplayName
properties. This will give you a list like the one below. This list is easier to work with.
Get-AppxPackage | Select-Object Name
Now you can see which Windows 10 apps you’d like to remove. At this point, you need to list all of the names of the packages you’d like to remove. One way to do that is to copy and paste the Windows 10 apps you’re interested in in removing and build a list that way. One trick that I use is to save the results to a text file and then open that file in Visual Studio Code. For example:
Get-AppxPackage | Select-object name | Out-File apps.txt | code apps.txt
In your external editor, begin building up an array of apps to remove.
$ProvisionedAppPackageNames = @()
Now that you have the list, you can start building the PowerShell script.
Removing Windows 10 Apps with PowerShell
You should now have an array defined in your editor that contains the names of all the AppX packages you’d like removed. I’ve come up with an example below.
$ProvisionedAppPackageNames = @(
"Microsoft.BingFinance"
"Microsoft.BingNews"
"Microsoft.BingSports"
"Microsoft.BingWeather"
"Microsoft.MicrosoftOfficeHub"
"Microsoft.Getstarted"
"microsoft.windowscommunicationsapps" # Mail,Calendar
"Microsoft.Office.OneNote"
"Microsoft.People"
"Microsoft.SkypeApp"
"Microsoft.XboxApp"
"Microsoft.ZuneMusic"
"Microsoft.ZuneVideo"
)
With the array populated with the specific applications to be removed, you can now set up the foreach loop to step through each package to uninstall using the Remove-AppXProvisionedPackage
cmdlet and the Remove-AppXPackage
cmdlet.
foreach ($ProvisionedAppName in $ProvisionedAppPackageNames) {
Get-AppxPackage -Name $ProvisionedAppName -AllUsers | Remove-AppxPackage
Get-AppXProvisionedPackage -Online | Where-Object DisplayName -EQ $ProvisionedAppName | Remove-AppxProvisionedPackage -Online
}
If for any reason you want to reinstall all applications, you can always use the add-AppXPackage
cmdlet to register the Windows 10 app again by specifying it’s application manifest XML file as shown below.
Get-AppxPackage -AllUsers | Foreach {
Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"
}
Summary
Even though Microsoft doesn’t make it easy to uninstall Windows 10 apps, you can see you’ll always have PowerShell to fall back onto!