
I have done these exact steps and can verify that Windows Defender no longer stalls my code builds using Visual Studio 2019. One final step, Set-ExecutionPolicy Restricted and then Get-ExecutionPolicy to verify it's restricted, it's very important not to overlook your Powershell Execution Policy as it's a very powerful attack vector. After running the script you're pretty much done. The script will ask where you store your project folders, this is important to exclude from Windows Defender. the "./" are important to run scripts from non-default directories. For simplicity, put the script in your root C: and navigate there then type. Then navigate to the directory of the script.

Simply download the Powershell script, open Windows Powershell, and type The solution is to add Windows Defender Exclusions to all the processes and directories you use for your development environment, this gets rather complicated to do on your own and differs depending on your development environment of choice, here I am using Visual Studio 2019 and will use a Powershell script to quickly add these exclusions. Powershell script that excludes all the necessary directories and processes for Visual Studio 2019 How to create and run Windows Powershell scripts

Microsoft description of the problem and simple fixes The solution I found was based on these articles: The problem here occurs due to Windows Defender Real-Time Protection, which is very important to keep the system safe.
