在 PowerShell 中使用 Windows Defender 排除特定目录,可以使用以下命令:
在 PowerShell 中使用 Windows Defender 排除特定目录,可以使用以下命令:
powershellCopy Code
Add-MpPreference -ExclusionPath "C:\Path\To\Your\Directory"
将 "C:\Path\To\Your\Directory"
替换为你要排除的实际目录路径。如果需要排除多个目录,可以重复该命令,或者使用逗号分隔多个路径:
powershellCopy Code
Add-MpPreference -ExclusionPath "C:\Path\To\Directory1", "C:\Path\To\Directory2"
确保以管理员身份运行 PowerShell。这样可以有效地管理 Defender 的排除设置。