Sycnex / Windows10Debloater

Script to remove Windows 10 bloatware.
MIT License
18.13k stars 2.04k forks source link

Critical: bloatware removal broken #74

Closed abulgatz closed 5 years ago

abulgatz commented 5 years ago

Line 30, the *s around .NET are not necessary and break the removal portion of the script.

With the -NoMatch operator on the following lines (31-33), it is already matching parts of strings in the $WhitelistedApps string. The *s are NOT wildcards in the context of PowerShell -Match or -NoMatch regex.

If you wanted to, you cold change the -Match to a -Like, which uses simplified Powershell regex language, where the *s are wildcards, and where partial string matching is not already implied.

Otherwise, just remove the *s around .NET and that should fix the script.

[regex]$WhitelistedApps = 'Microsoft.ScreenSketch|Microsoft.Paint3D|Microsoft.WindowsCalculator|Microsoft.WindowsStore|Microsoft.Windows.Photos|CanonicalGroupLimited.UbuntuonWindows|Microsoft.XboxGameCallableUI|Microsoft.XboxGamingOverlay|Microsoft.Xbox.TCUI|Microsoft.XboxGamingOverlay|Microsoft.XboxIdentityProvider|Microsoft.MicrosoftStickyNotes|Microsoft.MSPaint|Microsoft.WindowsCamera|*.NET*'

PS> $testvar = 'there is an error'
PS> $testvar -match 'error'
True
Sycnex commented 5 years ago

This is now resolved. Thank you!