mirror of
https://github.com/actions/runner-images.git
synced 2025-12-19 08:22:12 +00:00
14 lines
670 B
PowerShell
14 lines
670 B
PowerShell
Write-Host "Set antivirus parameters"
|
|
Set-MpPreference -ScanAvgCPULoadFactor 5 -ExclusionPath "D:\", "C:\"
|
|
|
|
Write-Host "Disable Antivirus"
|
|
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'
|
|
}
|