PowerTip: Use PowerShell to add exclusion folder to Windows Defender

Doctor Scripto

Summary: Use Windows PowerShell to add an exclusion folder to Windows Defender.

Hey, Scripting Guy! Question How can I add the C:\temp folder to the exclusion list so it is not scanned by Windows Defender?

Hey, Scripting Guy! Answer 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.

1 comment

Discussion is closed. Login to edit/delete existing comments.

  • VARADHA RAJAN K 0

    thanks for the PowerShell commands

Feedback usabilla icon