mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[platform] less intrusive update of the Defender exclusion list (follow-up to RIDER-128049)
GitOrigin-RevId: ed2d5455888db8424df1745de113ded791c4b0fb
This commit is contained in:
committed by
intellij-monorepo-bot
parent
a0755ba53b
commit
70b329fa88
@@ -1,6 +1,8 @@
|
||||
<#
|
||||
The script adds paths, given as parameters, to the Microsoft Defender folder exclusion list,
|
||||
unless they are already excluded.
|
||||
|
||||
See https://learn.microsoft.com/en-us/defender-endpoint/configure-extension-file-exclusions-microsoft-defender-antivirus
|
||||
#>
|
||||
|
||||
#Requires -RunAsAdministrator
|
||||
@@ -61,14 +63,12 @@ try {
|
||||
|
||||
foreach ($path in $args) {
|
||||
if (-not (Test-Excluded $path $exclusions)) {
|
||||
$exclusions += $path
|
||||
Add-MpPreference -ExclusionPath $path
|
||||
Write-Host "added: $path"
|
||||
} else {
|
||||
Write-Host "skipped: $path"
|
||||
}
|
||||
}
|
||||
|
||||
Set-MpPreference -ExclusionPath $exclusions
|
||||
} catch {
|
||||
Write-Host "$($_.Exception.GetType()): $($_.Exception.Message)"
|
||||
Write-Host $_.ScriptStackTrace
|
||||
|
||||
Reference in New Issue
Block a user