garry1103

windows 10 decrapification

Feb 16th, 2018
441
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # Anything listed within this array will not be removed.
  2. $retain = @(
  3.     'Microsoft.DesktopAppInstaller',
  4.     'Microsoft.Messaging',
  5.     'Microsoft.MSPaint',
  6.     'Microsoft.StorePurchaseApp',
  7.     'Microsoft.Windows.Photos',
  8.     'microsoft.windowscommunicationsapps',
  9.     'Microsoft.WindowsCalculator',
  10.     'Microsoft.WindowsStore',
  11.     'Microsoft.ZuneMusic',
  12.     'Microsoft.ZuneVideo'
  13. );
  14.  
  15. $apps = Get-AppxProvisionedPackage -Online
  16.  
  17. foreach($app in $apps) {
  18.     # If it exists within the retain array then skip this item and move onto the next.
  19.     if($retain.Contains($app.DisplayName)) { continue; }
  20.  
  21.     # Get the package, if its installed for the current user remove it.
  22.     $package = Get-AppxPackage -Name $app.DisplayName;
  23.     if(($package).PackageFullName) {
  24.         Get-AppxPackage $app.DisplayName | Remove-AppxPackage;
  25.     }
  26.     # Unprovision the package so new users don't have to put up with it.
  27.     Remove-AppxProvisionedPackage -Online -PackageName $app.PackageName;
  28.  
  29. }
Advertisement
Add Comment
Please, Sign In to add comment