Last active
February 17, 2026 11:54
-
-
Save GabiNun/6605ed5711a412e06db096b4e23cb4f2 to your computer and use it in GitHub Desktop.
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
| # This is an example of how to use the Windows Runtime (C#) | |
| # Windows.Management.Deployment API in PowerShell to remove AppX packages, | |
| # which is significantly faster than using Remove-AppxPackage. | |
| # this wont work in powershell 7+ | |
| $Packages = | |
| 'Microsoft.WindowsCalculator', | |
| 'Microsoft.WindowsCamera', | |
| 'Microsoft.WindowsAlarms', | |
| 'Microsoft.WindowsFeedbackHub', | |
| 'Microsoft.ZuneMusic', | |
| 'Microsoft.MicrosoftOfficeHub', | |
| 'Microsoft.BingSearch', | |
| 'Clipchamp.Clipchamp', | |
| 'Microsoft.BingNews', | |
| 'MSTeams', | |
| 'Microsoft.WindowsNotepad', | |
| 'Microsoft.Todos', | |
| 'Microsoft.OutlookForWindows', | |
| 'Microsoft.Paint', | |
| 'Microsoft.Windows.Photos', | |
| 'Microsoft.PowerAutomateDesktop', | |
| 'MicrosoftCorporationII.QuickAssist', | |
| 'Microsoft.ScreenSketch', | |
| 'Microsoft.MicrosoftSolitaireCollection', | |
| 'Microsoft.WindowsSoundRecorder', | |
| 'Microsoft.MicrosoftStickyNotes', | |
| 'Microsoft.BingWeather', | |
| 'Microsoft.WebMediaExtensions', | |
| 'Microsoft.GamingApp', | |
| 'Microsoft.Xbox.TCUI', | |
| 'Microsoft.Windows.DevHome', | |
| 'Microsoft.GetHelp', | |
| 'Microsoft.WindowsStore', | |
| 'MicrosoftWindows.CrossDevice', | |
| 'Microsoft.ApplicationCompatibilityEnhancements', | |
| 'Microsoft.YourPhone', | |
| 'Microsoft.XboxGamingOverlay', | |
| 'MicrosoftWindows.Client.WebExperience' | |
| $pm = [Windows.Management.Deployment.PackageManager, Windows.Management.Deployment, ContentType = WindowsRuntime]::new() | |
| Stop-Process -Name Widgets | |
| foreach ($package in $pm.FindPackages()) { | |
| if ($Packages -contains $package.Id.Name) { | |
| $pm.RemovePackageAsync($package.Id.FullName) | Out-Null | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment