mirror of
https://github.com/actions/runner-images-sangeeth.git
synced 2026-01-03 07:47:20 +08:00
Set Microsoft Defender Antivirus to passive mode (#4415)
This commit is contained in:
committed by
GitHub
parent
abdba31f29
commit
05c460a0b6
@@ -2,4 +2,12 @@ Write-Host "Set antivirus parameters"
|
||||
Set-MpPreference -ScanAvgCPULoadFactor 5 -ExclusionPath "D:\", "C:\"
|
||||
|
||||
Write-Host "Disable Antivirus"
|
||||
Set-MpPreference -DisableRealtimeMonitoring $true
|
||||
Set-MpPreference -DisableRealtimeMonitoring $true
|
||||
|
||||
# https://github.com/actions/virtual-environments/issues/4277
|
||||
# https://docs.microsoft.com/en-us/microsoft-365/security/defender-endpoint/microsoft-defender-antivirus-compatibility?view=o365-worldwide
|
||||
$atpRegPath = 'HKLM:\SOFTWARE\Policies\Microsoft\Windows Advanced Threat Protection'
|
||||
if (Test-Path $atpRegPath) {
|
||||
Write-Host "Set Microsoft Defender Antivirus to passive mode"
|
||||
Set-ItemProperty -Path $atpRegPath -Name 'ForceDefenderPassiveMode' -Value '1' -Type 'DWORD'
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user