Best Practices for Windows Defender with PowerShell cmdlets
You can get the Defender cmdlets by using the following commands:
- PS C:\> (Get-MpPreference).ExclusionPath
- Gets exclusion path of Defender.
- PS C:\> (Get-MpPreference).ExclusionProcess
- Gets exclusion processes of Defender.
- PS C:\> Add-MpPreference –ExclusionPath “full_path_of_the_folder_or_file”
- Excludes a folder or file to the exclusion list.
- PS C:\> Add-MpPreference –ExclusionProcess “full_path_of_executable_programs”
- Excludes files opened by the processes.
- PS C:\> Remove-MpPreference –ExclusionPath “full_path_of_the_folder”
- Removes a folder from the exclusion list.