Created
May 12, 2021 17:02
-
-
Save jmconway/dc7b73e6d1e5c1f7c7ba4b2c8a1ed7cf 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, of build 20H2 specifically in this gist. 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$provisioned = "Microsoft.GetHelp_10.1706.13331.0_neutral_~_8wekyb3d8bbwe","Microsoft.Getstarted_8.2.22942.0_neutral_~_8wekyb3d8bbwe","Microsoft.MicrosoftOfficeHub_18.1903.1152.0_neutral_~_8wekyb3d8bbwe","Microsoft.MicrosoftSolitaireCollection_4.4.8204.0_neutral_~_8wekyb3d8bbwe","Microsoft.Office.OneNote_16001.12026.20112.0_neutral_~_8wekyb3d8bbwe","Microsoft.People_2019.305.632.0_neutral_~_8wekyb3d8bbwe","Microsoft.Wallet_2.4.18324.0_neutral_~_8wekyb3d8bbwe","microsoft.windowscommunicationsapps_16005.11629.20316.0_neutral_~_8wekyb3d8bbwe","Microsoft.WindowsFeedbackHub_2019.1111.2029.0_neutral_~_8wekyb3d8bbwe","Microsoft.YourPhone_2019.430.2026.0_neutral_~_8wekyb3d8bbwe","Microsoft.ZuneMusic_2019.19071.19011.0_neutral_~_8wekyb3d8bbwe","Microsoft.ZuneVideo_2019.19071.19011.0_neutral_~_8wekyb3d8bbwe" | |
$appx = "Microsoft.Windows.PeopleExperienceHost","Microsoft.GetHelp","Microsoft.Getstarted","Microsoft.MicrosoftOfficeHub","Microsoft.MicrosoftSolitaireCollection","Microsoft.Office.OneNote","Microsoft.Wallet","microsoft.windowscommunicationsapps","Microsoft.WindowsFeedbackHub","Microsoft.YourPhone","Microsoft.ZuneMusic","Microsoft.ZuneVideo","Microsoft.People" | |
ForEach ($app in $provisioned) { | |
Get-AppxProvisionedPackage -Online | Where-Object {$_.PackageName -like $app} | Remove-AppxProvisionedPackage -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