Summary: Use Windows PowerShell to add an exclusion folder to Windows Defender.
How can I add the C:\temp folder to the exclusion list so it is not scanned by Windows Defender?
Use the Add-MpPreference cmdlet and specify the exclusion path, for example:
Add-MpPreference -ExclusionPath “C:\Temp”
Note You must run Windows PowerShell with elevated permissions when you execute this command or an error arises.
thanks for the PowerShell commands