Removing Windows Apps with Powershell

This one is a royal pain in the arse. It shouldn’t be, it should be easy and the information should be easy to find, its not.

But, thanks to my friend Georgia, we have the answer that works for at least up to 21H2 of Windows 10.

$Apps=@(
"Microsoft.XboxGamingOverlay",
"Microsoft.WindowsAlarms",
"Microsoft.ZuneVideo",
"Microsoft.MicrosoftEdge.Stable",
"Microsoft.SkypeApp",
"Microsoft.StorePurchaseApp",
"Microsoft.ZuneVideo",
"Microsoft.XboxGamingOverlay",
"Microsoft.BingWeather",
"Microsoft.SkypeApp",
"Microsoft.ZuneVideo",
"Microsoft.BingWeather",
"Microsoft.XboxGamingOverlay",
"Microsoft.StorePurchaseApp"
)

foreach($app in $apps)
    {
    Get-AppxPackage  -AllUsers $app -PackageTypeFilter all | Remove-AppxPackage -AllUsers
}

Ok so what is the magic here? Simply it’s the -PackageTypeFilter All. Many of the Microsoft apps are bundles, so if you are trying to remove them without that switch, you get errors.

If you also wish to make sure no new users get these apps then you will need to reprovision them as well:

foreach($app in $apps)
     {                                                         
     Get-AppxProvisionedPackage -online| Where-object {$_DisplayName -eq $app}| remove-AppxProvisionedPackage  -AllUsers -online
     }

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.