How do I add an exclusion path to Windows Defender to prevent it from scanning certain files or folders?
You can add exclusions via the Windows Security panel under **Virus & threat protection settings > Add or remove exclusions**, or via PowerShell as an administrator: `Add-MpPreference -ExclusionPath "C:\test"`. The registry location for path exclusions is `HKLM\SOFTWARE\Microsoft\Windows Defender\Exclusions\Paths`. To remove an exclusion, use `Remove-MpPreference -ExclusionPath "C:\test"`. For more on exclusion types and commands, refer to the Penetration Basics - Windows Defender article.
Windows Defender exclusion listAdd-MpPreferenceExclusionPathregistry