[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
This commit is contained in:
ilia-shipitsin
2023-09-14 22:17:45 +02:00
committed by GitHub
parent f23546c953
commit 27777e9f10

View File

@@ -17,6 +17,7 @@ $avPreference = @(
@{SubmitSamplesConsent = 2}
@{ScanAvgCPULoadFactor = 5; ExclusionPath = @("D:\", "C:\")}
@{DisableRealtimeMonitoring = $true}
@{ScanScheduleDay = 8}
)
$avPreference += @(
@@ -29,9 +30,6 @@ $avPreference | Foreach-Object {
Set-MpPreference @avParams
}
Write-Host "Disable Windows Defender scheduled tasks"
Get-ScheduledTask -TaskPath '\Microsoft\Windows\Windows Defender\' | Disable-ScheduledTask | Out-Null
# https://github.com/actions/runner-images/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'