AV Exclusions
Configure AV exclusion rules to avoid detection.
Windows Defender
Retrieve the current configuration:
Get-MpPreference | fl ExclusionExtension,ExclusionPath,ExclusionProcess
Disable scheduled and real-time scanning for files in this folder:
Add-MpPreference -ExclusionPath "C:\Temp"
Remove folder from exclusion list:
Remove-MpPreference -ExclusionPath "C:\Temp"
References:
https://docs.microsoft.com/en-us/powershell/module/defender/get-mppreference?view=win10-ps
https://docs.microsoft.com/en-us/powershell/module/defender/add-mppreference?view=win10-ps
https://docs.microsoft.com/en-us/powershell/module/defender/remove-mppreference?view=win10-ps