Skip to content

Commit 27777e9

Browse files
[windows] disabling windows defender scheduled task (#8285)
it turned out that windows defender creates deleted tasks. proper way of disabling is Set-MpPreference -ScanScheduleDay 8
1 parent f23546c commit 27777e9

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

images/win/scripts/Installers/Configure-Antivirus.ps1

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ $avPreference = @(
1717
@{SubmitSamplesConsent = 2}
1818
@{ScanAvgCPULoadFactor = 5; ExclusionPath = @("D:\", "C:\")}
1919
@{DisableRealtimeMonitoring = $true}
20+
@{ScanScheduleDay = 8}
2021
)
2122

2223
$avPreference += @(
@@ -29,9 +30,6 @@ $avPreference | Foreach-Object {
2930
Set-MpPreference @avParams
3031
}
3132

32-
Write-Host "Disable Windows Defender scheduled tasks"
33-
Get-ScheduledTask -TaskPath '\Microsoft\Windows\Windows Defender\' | Disable-ScheduledTask | Out-Null
34-
3533
# https://github.com/actions/runner-images/issues/4277
3634
# https://docs.microsoft.com/en-us/microsoft-365/security/defender-endpoint/microsoft-defender-antivirus-compatibility?view=o365-worldwide
3735
$atpRegPath = 'HKLM:\SOFTWARE\Policies\Microsoft\Windows Advanced Threat Protection'

0 commit comments

Comments
 (0)