Skip to content

Instantly share code, notes, and snippets.

@wise-io
Last active September 10, 2024 21:08
Show Gist options
  • Save wise-io/cbf80791f2ee72ed7a39cd828598e861 to your computer and use it in GitHub Desktop.
Save wise-io/cbf80791f2ee72ed7a39cd828598e861 to your computer and use it in GitHub Desktop.
PowerShell script to silently remove various Windows Store applications.
# Remove unnecessary packages
$Allowlist = @(
'DellCommandUpdate', # Dell Command Update app
'HPPrinterControl' # HP Smart app
)
$Identifiers = @(
'AcerIncorporated', # Acer Identifier
'AD2F1837', # HP Identifier
'B9ECED6F', # Asus Identifier
'CyberLinkCorp', # CyberLink Identifier
'DB6EA5DB', # Dell Identifier
'DellInc', # Dell Identifier
'E046963F', # Lenovo Identifier
'E0469640', # Lenovo Identifier
# Game Publisher Identifiers
'828B5831',
'26720RandomSaladGamesLLC',
'A278AB0D',
'D52A8D61',
'king.com',
'WildTangent'
)
$UninstallPackages = @(
'2FE3CB00.PicsArt-PhotoStudio',
'4DF9E0F8.Netflix',
'5A894077.McAfeeSecurity',
'6Wunderkinder.Wunderlist',
'7EE7776C.LinkedInforWindows',
'9E2F88E3.Twitter',
'57540AMZNMobileLLC.AmazonAlexa',
'A-Volute.Nahimic',
'AdobeSystemsIncorporated.AdobePhotoshopExpress',
'Amazon.com.Amazon',
'AMZNMobileLLC.KindleforWindows8',
'AppUp.IntelGraphicsExperience',
'Aura-YourDigitalHalo.FigLeaf',
'AutodeskSketchBook',
'BytedancePte.Ltd.TikTok',
'C27EB4BA.DropboxOEM',
'CAF9E577.Plex',
'Clipchamp.Clipchamp',
'CyberLinkCorp.ac.PowerDirectorforacerDesktop',
'Disney.37853FC22B2CE',
'DolbyLaboratories.DolbyAccess',
'Drawboard.DrawboardPDF',
'eBayInc.eBay',
'Evernote.Evernote',
'FACEBOOK.317180B0BB486',
'Flipboard.Flipboard',
'McAfeeInc.01.McAfeeSecurityAdvisorforDell',
'Microsoft.3DBuilder',
'Microsoft.BingFinance',
'Microsoft.BingFoodAndDrink',
'Microsoft.BingHealthAndFitness',
'Microsoft.BingNews',
'Microsoft.BingSports',
'Microsoft.BingTranslator',
'Microsoft.BingTravel',
'Microsoft.BingWeather',
'Microsoft.GamingApp',
'Microsoft.GetHelp',
'Microsoft.Getstarted',
'Microsoft.Messaging',
'Microsoft.Microsoft3DViewer',
'Microsoft.MicrosoftOfficeHub',
'Microsoft.MicrosoftSolitaireCollection',
'Microsoft.MinecraftUWP',
'Microsoft.MixedReality.Portal',
'Microsoft.Office.OneNote',
'Microsoft.Office.Sway',
'Microsoft.OneConnect',
'Microsoft.PowerAutomateDesktop',
'Microsoft.Print3D',
'Microsoft.Reader',
'Microsoft.RemoteDesktop',
'Microsoft.SkypeApp',
'Microsoft.Todos',
'Microsoft.Wallet',
'Microsoft.WindowsFeedbackHub',
'Microsoft.WindowsMaps',
'Microsoft.WindowsReadingList',
'Microsoft.Xbox.TCUI',
'Microsoft.XboxApp',
'Microsoft.XboxGameOverlay',
'Microsoft.XboxGamingOverlay',
'Microsoft.YourPhone',
'MicrosoftTeams',
'MicrosoftWindows.Client.WebExperience',
'MirametrixInc.GlancebyMirametrix',
'PandoraMediaInc.29680B314EFC2',
'PricelinePartnerNetwork.Booking.comUSABigsavingson',
'RivetNetworks.SmartByte',
'ROBLOXCORPORATION.ROBLOX',
'ScreenovateTechnologies.DellMobileConnect',
'SpotifyAB.SpotifyMusic',
'WavesAudio.MaxxAudioProforDell2020',
'WavesAudio.MaxxAudioProforDell2022',
'WavesAudio.WavesMaxxAudioProforDell'
)
$MatchAllowlist = '(' + ($Allowlist -join ')|(') + ')'
$MatchIdentifiers = '(^' + ($Identifiers -join ')|(^') + ')'
$Packages = Get-AppxPackage -AllUsers | Where-Object { (($UninstallPackages -contains $_.Name) -or ($_.Name -match $MatchIdentifiers)) -and ($_.Name -notmatch $MatchAllowlist) }
$ProvisionedPackages = Get-AppxProvisionedPackage -Online | Where-Object { (($UninstallPackages -contains $_.DisplayName) -or ($_.DisplayName -match $MatchIdentifiers)) -and ($_.DisplayName -notmatch $MatchAllowlist) }
ForEach ($ProvisionedPackage in $ProvisionedPackages) {
Write-Output "Attempting to remove provisioned package: [$($ProvisionedPackage.DisplayName)]"
try {
$Null = Remove-AppxProvisionedPackage -PackageName $ProvisionedPackage.PackageName -Online -AllUsers -ErrorAction Stop
Write-Output "Successfully removed provisioned package: [$($ProvisionedPackage.DisplayName)]"
}
catch { Write-Warning -Message "Failed to remove provisioned package: [$($ProvisionedPackage.DisplayName)]" }
}
ForEach ($Package in $Packages) {
Write-Output "Attempting to remove package: [$($Package.Name)]"
try {
$Null = Remove-AppxPackage -Package $Package.PackageFullName -AllUsers -ErrorAction Stop
Write-Output "Successfully removed package: [$($Package.Name)]"
}
catch { Write-Warning -Message "Failed to remove provisioned package: [$($Package.Name)]" }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment