Advanced Windows Defender configuration with PowerShell
PowerShell allows granular configuration of Windows Defender: folder and process exclusions, cloud protection level, behavior for potentially unwanted applications (PUA) and quarantine configuration.
Add folder exclusion
Add-MpPreference -ExclusionPath "C:\MyApp\bin"
View current configuration
Get-MpPreference | Select-Object ExclusionPath, ExclusionProcess, CloudBlockLevel
Most useful Set-MpPreference parameters
| Parameter | Description |
|---|---|
-ExclusionPath | Excludes a path from scanning |
-ExclusionProcess | Excludes a process by name |
-CloudBlockLevel | Cloud blocking level (0-6) |
-PUAProtection | Block potentially unwanted apps |
-DisableRealtimeMonitoring | Disable real-time monitoring (admin) |