Speeding up WSL I/O up to 5x faster
medium.com
medium.com
Create a file `toggle-defender-real-time-protection.ps1` in a known location with the following content:
$preferences = Get-MpPreference
Set-MpPreference -DisableRealtimeMonitoring (!$preferences.DisableRealtimeMonitoring)
Then create a shortcut for this target: %SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Bypass -File "toggle-defender-real-time-protection.ps1"
Make it run as Administrator.(Source of this nice script: https://superuser.com/a/1287788/25933)
Note that Windows somehow turns the protection on after a random amount of time.
I'd definitely just add exclusions though, rather than disabling it entirely.
Turning off REALTIME protection is the only thing I am to use to get relief from this problem.
Anyways, this is the first thing I do on a dev machine. Usually I remove any A/V completely, not just disable it. Because top of the line core-i7 machine with all "security" features enabled works no faster than venerable 486dx.