Windows10Debloater
Windows10Debloater copied to clipboard
Fix a typo in WhitelistedApps String that prevents it from working properly
The backquote in the string does not have the anticipated effect of joining the multiple lines. It's taken as a character and prevent some parts of the regular expression from being executed. With this fix the FixWhitelistedApps run is most probably useless as they won't be removed.
Hm.. I see. This is why the whitelist had issues. Great pull, might work.
As an improvement you can use smaller regex code, and use \. instead of . (which is any char). Adding suggested from w11 in #453 and Xaml, VCLibs. And more important, filter out all System apps which speeds up a lot:
[regex]$WhitelistedApps = "ScreenSketch|Paint3D|WindowsCalculator|WindowsStore|Windows\.Photos|UbuntuonWindows|" `
+ "StickyNotes|MSPaint|WindowsCamera|\.NET|HEIFImageExtension|ScreenSketch|StorePurchaseApp|" `
+ "VP9VideoExtensions|WebMediaExtensions|WebpImageExtension|DesktopAppInstaller|" `
+ "MixedReality|Nvidia|Slack|\.Paint|VCLibs|WindowsNotepad|WindowsTerminal|Xaml"
Get-AppxPackage -AllUsers |
Where-Object {$_.Name -NotMatch $WhitelistedApps -and $_.SignatureKind -ne "System"} |
Remove-AppxPackage -ErrorAction SilentlyContinue
# Run this again to avoid error on 1803 or having to reboot.
Get-AppxPackage -AllUsers |
Where-Object {$_.Name -NotMatch $WhitelistedApps -and $_.SignatureKind -ne "System"} |
Remove-AppxPackage -ErrorAction SilentlyContinue