Windows10Debloater icon indicating copy to clipboard operation
Windows10Debloater copied to clipboard

Fix a typo in WhitelistedApps String that prevents it from working properly

Open oboudry opened this issue 3 years ago • 2 comments

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.

oboudry avatar Jan 13 '22 15:01 oboudry

Hm.. I see. This is why the whitelist had issues. Great pull, might work.

tort-oise avatar Jan 15 '22 11:01 tort-oise

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

isidroco avatar Mar 15 '22 00:03 isidroco