Skip to content

Instantly share code, notes, and snippets.

@jmconway
Created May 11, 2021 18:19
Show Gist options
  • Save jmconway/00851c1ad97d3d701c00a8636fab8768 to your computer and use it in GitHub Desktop.
Save jmconway/00851c1ad97d3d701c00a8636fab8768 to your computer and use it in GitHub Desktop.
A basic script for removing Windows 10 AppX Packages and Provisioned Packages run during my WDS/MDT deployment. While I don't recommend sysprep anymore, note that in order to avoid issues with it or other operations, both related AppX packages and AppX provisioned packages need to be removed.
$provisioned = "Microsoft.BingWeather","Microsoft.GetHelp","Microsoft.Getstarted","Microsoft.Messaging","Microsoft.MicrosoftOfficeHub","Microsoft.MicrosoftSolitaireCollection","Microsoft.Office.OneNote","Microsoft.OneConnect","Microsoft.People","Microsoft.People","Microsoft.Wallet","microsoft.windowscommunicationsapp","Microsoft.WindowsFeedbackHub","Microsoft.WindowsMaps","Microsoft.YourPhone","Microsoft.ZuneMusic","Microsoft.ZuneVideo"
$appx = "Microsoft.Windows.PeopleExperienceHost","Microsoft.BingWeather","Microsoft.GetHelp","Microsoft.Getstarted","Microsoft.Messaging","Microsoft.MicrosoftOfficeHub","Microsoft.MicrosoftSolitaireCollection","Microsoft.Office.OneNote","Microsoft.OneConnect","Microsoft.People","Microsoft.SkypeApp","Microsoft.Wallet","microsoft.windowscommunicationsapps","Microsoft.WindowsFeedbackHub","Microsoft.WindowsMaps","Microsoft.YourPhone","Microsoft.ZuneMusic","Microsoft.ZuneVideo"
ForEach ($app in $provisioned) {
Get-AppxProvisionedPackage -Online | Where-Object {$_.PackageName -like $app} | Remove-AppxProvisonedPackage -Online
}
ForEach ($app in $appx) {
Get-AppxPackage -AllUsers | Where-Object {$_.Name -eq $app} | Remove-AppxPackage -AllUsers
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment