PowerTip: Use PowerShell to add exclusion folder to Windows Defender

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.

Comments (1)

  1. Max B says:

    add-mppreference : The term ‘add-mppreference’ is not recognized as the name of a cmdlet, function, script file, or operable program.

Skip to main content