Skip to content

Commit 70f1595

Browse files
authored
Update WindowsDefenderConfigurator.java
@fdcastel, I've updated the script to simplify it as suggested. It now directly uses `Add-MpPreference -ExclusionProcess $pathsToExclude` without the extra conditionals or set creation. Let me know if anything else needs tweaking. Thanks! cc @HannesWell
1 parent caf59c0 commit 70f1595

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

bundles/org.eclipse.ui.workbench/eclipseui/org/eclipse/ui/internal/WindowsDefenderConfigurator.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -346,9 +346,7 @@ public static String createAddExclusionsPowershellCommand(String extraSeparator)
346346
.collect(Collectors.joining(','));
347347
return String.join(";",
348348
"$pathsToExclude = @(" + excludedPaths + ")",
349-
"$existingExclusions = New-Object Collections.Generic.HashSet[String] -ArgumentList @([string[]](Get-MpPreference).ExclusionProcess)",
350-
"$pathsToAdd = $pathsToExclude | Where-Object { -not $existingExclusions.Contains($_) }",
351-
"if ($pathsToAdd) { Add-MpPreference -ExclusionProcess $pathsToAdd }"
349+
"Add-MpPreference -ExclusionProcess $pathsToExclude"
352350
);
353351
}
354352

0 commit comments

Comments
 (0)