mirror of
https://github.com/actions/runner-images-sangeeth.git
synced 2026-01-04 00:44:52 +08:00
[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:
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user