mirror of
https://github.com/actions/runner-images.git
synced 2026-01-04 17:18:52 +08:00
Bypass Windows Defender false alarm (#5969)
This commit is contained in:
committed by
GitHub
parent
11cfd9eac0
commit
cbcc50c80d
@@ -1,25 +1,34 @@
|
|||||||
Write-Host "Disable Windows Defender..."
|
Write-Host "Disable Windows Defender..."
|
||||||
Set-MpPreference -DisableArchiveScanning $true
|
$avPreference = @(
|
||||||
Set-MpPreference -DisableAutoExclusions $true
|
@{DisableArchiveScanning = $true}
|
||||||
Set-MpPreference -DisableBehaviorMonitoring $true
|
@{DisableAutoExclusions = $true}
|
||||||
Set-MpPreference -DisableBlockAtFirstSeen $true
|
@{DisableBehaviorMonitoring = $true}
|
||||||
Set-MpPreference -DisableCatchupFullScan $true
|
@{DisableBlockAtFirstSeen = $true}
|
||||||
Set-MpPreference -DisableCatchupQuickScan $true
|
@{DisableCatchupFullScan = $true}
|
||||||
Set-MpPreference -DisableIntrusionPreventionSystem $true
|
@{DisableCatchupQuickScan = $true}
|
||||||
Set-MpPreference -DisableIOAVProtection $true
|
@{DisableIntrusionPreventionSystem = $true}
|
||||||
Set-MpPreference -DisablePrivacyMode $true
|
@{DisableIOAVProtection = $true}
|
||||||
Set-MpPreference -DisableScanningNetworkFiles $true
|
@{DisablePrivacyMode = $true}
|
||||||
Set-MpPreference -DisableScriptScanning $true
|
@{DisableScanningNetworkFiles = $true}
|
||||||
Set-MpPreference -MAPSReporting 0
|
@{DisableScriptScanning = $true}
|
||||||
Set-MpPreference -PUAProtection 0
|
@{MAPSReporting = 0}
|
||||||
Set-MpPreference -SignatureDisableUpdateOnStartupWithoutEngine $true
|
@{PUAProtection = 0}
|
||||||
Set-MpPreference -SubmitSamplesConsent 2
|
@{SignatureDisableUpdateOnStartupWithoutEngine = $true}
|
||||||
Set-MpPreference -ScanAvgCPULoadFactor 5 -ExclusionPath "D:\", "C:\"
|
@{SubmitSamplesConsent = 2}
|
||||||
Set-MpPreference -DisableRealtimeMonitoring $true
|
@{ScanAvgCPULoadFactor = 5; ExclusionPath = @("D:\", "C:\")}
|
||||||
|
@{DisableRealtimeMonitoring = $true}
|
||||||
|
)
|
||||||
|
|
||||||
if (-not (Test-IsWin16)) {
|
if (-not (Test-IsWin16)) {
|
||||||
Set-MpPreference -EnableControlledFolderAccess Disable
|
$avPreference += @(
|
||||||
Set-MpPreference -EnableNetworkProtection Disabled
|
@{EnableControlledFolderAccess = "Disable"}
|
||||||
|
@{EnableNetworkProtection = "Disabled"}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
$avPreference | Foreach-Object {
|
||||||
|
$avParams = $_
|
||||||
|
Set-MpPreference @avParams
|
||||||
}
|
}
|
||||||
|
|
||||||
Write-Host "Disable Windows Defender scheduled tasks"
|
Write-Host "Disable Windows Defender scheduled tasks"
|
||||||
|
|||||||
Reference in New Issue
Block a user