Fixed whitelisted apps being removed

I fixed an issue where the whitelisted apps; Paint3D, Calculator, Store, and Photos were being removed.

I changed the conditional operator from -notlike to -notcontains on lines 22-25, and lines 30-33. Then, I removed the asterisks from each AppXPackage/AppXProvisionedPackage name. 

The issue of the whitelisted apps being removed should no longer be the case.
This commit is contained in:
Richard Newton 2018-02-16 19:59:14 -08:00 committed by GitHub
parent 3f628a709c
commit 542619fa87
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -19,18 +19,18 @@ Function Start-Debloat {
#Removes AppxPackages
Get-AppxPackage -AllUsers |
Where-Object {$_.name -notlike "*Microsoft.Paint3D*"} |
Where-Object {$_.name -notlike "*Microsoft.WindowsCalculator*"} |
Where-Object {$_.name -notlike "*Microsoft.WindowsStore*"} |
Where-Object {$_.name -notlike "*Microsoft.Windows.Photos*"} |
Where-Object {$_.name -notcontains "Microsoft.Paint3D"} |
Where-Object {$_.name -notcontains "Microsoft.WindowsCalculator"} |
Where-Object {$_.name -notcontains "Microsoft.WindowsStore"} |
Where-Object {$_.name -notcontains "Microsoft.Windows.Photos"} |
Remove-AppxPackage -ErrorAction SilentlyContinue
#Removes AppxProvisionedPackages
Get-AppxProvisionedPackage -online |
Where-Object {$_.packagename -notlike "*Microsoft.Paint3D*"} |
Where-Object {$_.packagename -notlike "*Microsoft.WindowsCalculator*"} |
Where-Object {$_.packagename -notlike "*Microsoft.WindowsStore*"} |
Where-Object {$_.packagename -notlike "*Microsoft.Windows.Photos*"} |
Where-Object {$_.packagename -notcontains "Microsoft.Paint3D"} |
Where-Object {$_.packagename -notcontains "Microsoft.WindowsCalculator"} |
Where-Object {$_.packagename -notcontains "Microsoft.WindowsStore"} |
Where-Object {$_.packagename -notcontains "Microsoft.Windows.Photos"} |
Remove-AppxProvisionedPackage -online -ErrorAction SilentlyContinue
}
Function Remove-Keys {