| # Copyright 2022 The Go Authors. All rights reserved. |
| # Use of this source code is governed by a BSD-style |
| # license that can be found in the LICENSE file. |
| |
| Set-StrictMode -Version Latest |
| |
| Write-Host "Adding drive and process exclusions" |
| |
| # Antivirus setup. |
| |
| Add-MpPreference -ExclusionPath "C:\" -ErrorAction SilentlyContinue |
| Add-MpPreference -ExclusionProcess "C:\*" -ErrorAction SilentlyContinue |
| |
| Write-Host "Attempting to disable scanning engines via Set-MpPreference" |
| |
| Set-MpPreference -DisableArchiveScanning 1 -ErrorAction SilentlyContinue |
| Set-MpPreference -DisableBehaviorMonitoring 1 -ErrorAction SilentlyContinue |
| Set-MpPreference -DisableIntrusionPreventionSystem 1 -ErrorAction SilentlyContinue |
| Set-MpPreference -DisableIOAVProtection 1 -ErrorAction SilentlyContinue |
| Set-MpPreference -DisableRemovableDriveScanning 1 -ErrorAction SilentlyContinue |
| Set-MpPreference -DisableBlockAtFirstSeen 1 -ErrorAction SilentlyContinue |
| Set-MpPreference -DisableScanningMappedNetworkDrivesForFullScan 1 -ErrorAction SilentlyContinue |
| Set-MpPreference -DisableScanningNetworkFiles 1 -ErrorAction SilentlyContinue |
| Set-MpPreference -DisableScriptScanning 1 -ErrorAction SilentlyContinue |
| Set-MpPreference -DisableRealtimeMonitoring 1 -ErrorAction SilentlyContinue |
| |
| Write-Host "Setting default actions to Allow via Set-MpPreference" |
| |
| Set-MpPreference -LowThreatDefaultAction Allow -ErrorAction SilentlyContinue |
| Set-MpPreference -ModerateThreatDefaultAction Allow -ErrorAction SilentlyContinue |
| Set-MpPreference -HighThreatDefaultAction Allow -ErrorAction SilentlyContinue |
| |