Thursday, February 18, 2021

Removing Windows 10 Provisioned Universal Windows Platform (UWP) (AppX) apps

 

During a first logon to Windows 10 some time is taken to setup UWP apps for the user.  During the build phase you may wish to remove some of the ones you do not need.

Microsoft.549981C3F5F10
Microsoft.BingWeather
Microsoft.DesktopAppInstaller
Microsoft.GetHelp
Microsoft.Getstarted
Microsoft.HEIFImageExtension
Microsoft.Microsoft3DViewer
Microsoft.MicrosoftEdge.Stable
Microsoft.MicrosoftOfficeHub
Microsoft.MicrosoftSolitaireCollection
Microsoft.MicrosoftStickyNotes
Microsoft.MixedReality.Portal
Microsoft.MSPaint
Microsoft.Office.OneNote
Microsoft.People
Microsoft.ScreenSketch
Microsoft.SkypeApp
Microsoft.StorePurchaseApp
Microsoft.VCLibs.140.00
Microsoft.VP9VideoExtensions
Microsoft.Wallet
Microsoft.WebMediaExtensions
Microsoft.WebpImageExtension
Microsoft.Windows.Photos
Microsoft.WindowsAlarms
Microsoft.WindowsCalculator
Microsoft.WindowsCamera
microsoft.windowscommunicationsapps
Microsoft.WindowsFeedbackHub
Microsoft.WindowsMaps
Microsoft.WindowsSoundRecorder
Microsoft.WindowsStore
Microsoft.Xbox.TCUI
Microsoft.XboxApp
Microsoft.XboxGameOverlay
Microsoft.XboxGamingOverlay
Microsoft.XboxIdentityProvider
Microsoft.XboxSpeechToTextOverlay
Microsoft.YourPhone
Microsoft.ZuneMusic
Microsoft.ZuneVideo

Run this script logged in as admin and elevated.

#get provisioned apps
$AppxProv = Get-AppxProvisionedPackage -Online

#Enter the Apps you want to keep into this array

$AppsToKeep = @("Microsoft.MicrosoftOfficeHub","Microsoft.WindowsCalculator","Microsoft.Office.OneNote","Microsoft.WindowsCamera")

#loop through them

foreach ($AppxProvItem in $AppxProv)

    {
    
    $AppxprvDN = $AppxProvItem | Select -expand DisplayName

         if ($AppxprvDN -notin $AppsToKeep)

            {
            #Get the package full name
            $AppxTargetPFN = Get-AppxPackage -Name $AppxPrvDN | Select -expand PackageFullName

            #first remove the package from the logged on session
            Remove-AppxPackage -Package $AppxTargetPFN

            #then target the provisioned Appx version
            $AppxPrvTarget = Get-AppxProvisionedPackage -Online | where{$_.DisplayName -like $AppxPrvDN}

            $AppxPrvTargetPN = $AppxPrvTarget | Select -expand PackageName

            Remove-AppxProvisionedPackage -Online -PackageName $AppxPrvTargetPN

            }

    }