Windows – Install and Uninstall Microsoft Apps via PowerShell

best-windows-10-apps

As an administrator on your PC you can uninstall most of the built-in apps without a 3rd party application. You can uninstall even some apps that don’t offer an Uninstall option. There are a few apps that cannot be removed and will display an error if you try. You can also reinstall them via PowerShell, if needed. Similarly you can uninstall any other app you installed from the Microsoft Store.

1. Uninstall default Windows apps

First, right click the Windows button (or press Win + X) and choose Windows PowerShell (Admin) from the menu.

At the PowerShell prompt, copy and paste one or more of the following commands to remove the apps you don’t want on your Windows system (press Enter after each command):

Uninstall 3D Builder:
Get-AppxPackage *3dbuilder* | Remove-AppxPackage

Uninstall Alarms and Clock:
Get-AppxPackage *windowsalarms* | Remove-AppxPackage

Uninstall Calculator:
Get-AppxPackage *windowscalculator* | Remove-AppxPackage

Uninstall Calendar and Mail:
Get-AppxPackage *windowscommunicationsapps* | Remove-AppxPackage

Uninstall Camera:
Get-AppxPackage *windowscamera* | Remove-AppxPackage

Uninstall Contact Support:
This app can’t be removed.

Uninstall Cortana:
This app can’t be removed.

Uninstall Get Office:
Get-AppxPackage *officehub* | Remove-AppxPackage

Uninstall Get Skype:
Get-AppxPackage *skypeapp* | Remove-AppxPackage

Uninstall Get Started:
Get-AppxPackage *getstarted* | Remove-AppxPackage

Uninstall Groove Music:
Get-AppxPackage *zunemusic* | Remove-AppxPackage

Uninstall Maps:
Get-AppxPackage *windowsmaps* | Remove-AppxPackage

Uninstall Microsoft Edge:
This app can’t be removed.

Uninstall Microsoft Solitaire Collection:
Get-AppxPackage *solitairecollection* | Remove-AppxPackage

Uninstall Money:
Get-AppxPackage *bingfinance* | Remove-AppxPackage

Uninstall Movies & TV:
Get-AppxPackage *zunevideo* | Remove-AppxPackage

Uninstall News:
Get-AppxPackage *bingnews* | Remove-AppxPackage

Uninstall OneNote:
Get-AppxPackage *onenote* | Remove-AppxPackage

Uninstall People:
Get-AppxPackage *people* | Remove-AppxPackage

Uninstall Phone Companion:
Get-AppxPackage *windowsphone* | Remove-AppxPackage

Uninstall Your Phone:
Get-AppxPackage Microsoft.YourPhone -AllUsers | Remove-AppxPackage

Uninstall Photos:
Get-AppxPackage *photos* | Remove-AppxPackage

Uninstall Store:
Get-AppxPackage *windowsstore* | Remove-AppxPackage

Uninstall Sports:
Get-AppxPackage *bingsports* | Remove-AppxPackage

Uninstall Voice Recorder:
Get-AppxPackage *soundrecorder* | Remove-AppxPackage

Uninstall Weather:
Get-AppxPackage *bingweather* | Remove-AppxPackage

Uninstall Windows Feedback:
This app can’t be removed.

Uninstall Xbox:
Get-AppxPackage *xboxapp* | Remove-AppxPackage

The only real advantage to doing this is some mild decluttering of your Start menu. It’s also likely that future updates (especially major updates) could reinstall those apps.

2. Reinstall Windows apps

If you decide you want the preinstalled apps back, you can reinstall them all with a single line of code. Again, open a PowerShell window as an Administrator. Copy and paste the following line at the PowerShell prompt, and then press Enter: Get-AppxPackage -AllUsers| Foreach {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}

This command tells Windows to install those default apps again. Give it some time and allow it to finish, even if nothing appears to happen at first. Even if you see an error message, restart your PC, and then examine your Start menu – you may just have all those default apps back again, anyway.\

3. Install an app downloaded separately (eg. on an isolated system – offline, corporate, or one that doesn’t have Microsoft Store – LTSC)

a. First – downloading an app separately

– Open your browser, go to the Microsoft Store and open the page of the application you need. Let’s take for example some app that can be used offline – a Calculator+. Copy its link.

– In another tab, open the following link: https://store.rg-adguard.net/

– Paste the link of Calculator+ in the field on the page above, then select Retail in the drop-down list on the right, and click the button to the far right

appx_link_generator

– You will see a list of links to the appx installation files and required dependencies. Dependencies are applications or libraries that need to be installed for the app to work properly.

– You don’t need to download all of the files that appear. For Windows 10 x64, you need packages whose names end in x64 (for the 32-bit version of Windows 10, you need to download x86 packages, and for an ARM version of Windows – arm)

– You don’t need to download all the files in a row. It is enough to download the latest version of the program. For example, for the Calculator+ app you only need to download the latest version of  the Microsoft.VCLibs.140.00_14.0.30704.0_x64__8wekyb3d8bbwe.appx library – these are the required dependencies for the Calculator+ app to worok

appx_link_to_download

– If the resulting list of files also contains packages with the .appxbundle extension, download them as well. If the downloaded file does not have an extension, add the extension .appxbundle manually. There may also be other installation file formats in the Microsoft Store: .msixbundle (MSI installer) and .EAppx (appx app update).

– I downloaded the following 4 files – app + 3 dependencies:
14385JonasZoche.Rechner_4.1.7968.70_neutral_~_7yjengah4ymn8.appxBundle
Microsoft.VCLibs.140.00_14.0.30704.0_x64__8wekyb3d8bbwe.Appx

Microsoft.NET.Native.Framework.2.2_2.2.29512.0_x64__8wekyb3d8bbwe.appx
Microsoft.NET.Native.Runtime.2.2_2.2.28604.0_x64__8wekyb3d8bbwe.appx

b. Second – installing the app

– Copy the appx (appxbundle, EAppxbundle) app and dependencies files to another Windows 10 (Server 2016/2019) computer and install offline bypassing the Windows Store with a simple double click on the appx file.

– Also, you can install the APPX application with all dependencies using PowerShell. A standalone APPX app file can be installed with the following command: Add-AppxPackage -path "D:\APPX\Microsoft.VCLibs.140.00_14.0.30704.0_x64__8wekyb3d8bbwe.Appx"

– If you need to install several appx/appxbundle files with dependencies at once, copy all downloaded files into one directory and install them with the following PowerShell script (just copy and paste the following lines at the PowerShell window): $Path = 'D:\APPX'
Get-Childitem $Path -filter *.appx| %{Add-AppxPackage -Path $_.FullName}
Get-Childitem $Path -filter *.appxbundle | %{Add-AppxPackage -Path $_.FullName}

– Check that your application is installed and that its icon appears in Windows 10 Start menu.

– If you try to install an APPX application without first installing the dependencies, an error will appear: Deployment failed with HRESULT: 0x80073CF3, Package failed updates, dependency, or conflict validation. Windows cannot install resource package XXXXX because the app package it requires could not be found. Ensure that the app package is installed before installing the resource package.

– The graphical installer may show the package name to be installed: App Installer failed to install package dependencies. Ask the developer for XXXXX package.

– If you got all the dependencies and when trying to install you receive an error like: error 0x80073D02: Unable to install because the following apps need to be closed MicrosoftWindows.Client.CBS_120.2212.4 170.0_x64__cw5n1h2txyewy, this might be because of a compatibility error since you might have a newer version of Visual C++ installed than the one you are trying to install (in this case it’s Visual C++ 2015). Simply removing the “troublesome” VC package won’t cut it, so you will have to uninstall the newer Visual C++ library, then install the app using the set of 3 lines above, then reinstalling the newer library.

4. Uninstalling any application you installed from Microsoft Store

One day I installed PDF Office but was not happy with the features offered by the free version so I wanted to uninstall it. This were my steps towards uninstalling it:

– Open Windows PowerShell (Admin) by right clicking the start menu

Since the app is named PDF Office, I assumed I should look for *pdfoffice* so I entered the following command in PS then hit ENTER: Get-AppxPackage *pdfoffice*

– I got the details of the app: name, publisher, version, install location etc. so I was able to confirm this was the app I installed, as it’s full description in the store is PDF Office: PDF Editor, Reader, Merged, Create PDF…. and the app name I got with the above command is: 58337MediaAppsDev.PDFOfficePDFEditorReaderMergerCr

– In order to uninstall this product I just have to pipeline the Remove-AppxPackage command after the command in no. 2, like this: Get-AppxPackage *pdfoffice* | Remove-AppxPackage

– The uninstall happened real quick and checking my Microsoft Store, instead of Launch button in the app I have the Install button.