Show and delete settings.
authorOleksandr Gavenko <gavenkoa@gmail.com>
Mon, 29 Apr 2019 03:18:34 +0300
changeset 2359 52bb40bb41b0
parent 2358 c7a7c6b59840
child 2360 5179f42afc84
Show and delete settings.
windows-perf.rst
--- a/windows-perf.rst	Mon Apr 29 02:55:18 2019 +0300
+++ b/windows-perf.rst	Mon Apr 29 03:18:34 2019 +0300
@@ -46,8 +46,26 @@
 * Navigate to the directory to be excluded, or paste its path into the "Folder" text-box, and click
   "Select Folder".
 
+Same from elevated CLI::
+
+  powershell -Command Add-MpPreference -ExclusionPath "C:\tmp"
+  powershell -Command Add-MpPreference -ExclusionProcess "java.exe"
+  powershell -Command Add-MpPreference -ExclusionExtension ".java"
+
+To show and delete settings::
+
+  powershell -Command "Get-MpPreference | Select -Expand ExclusionPath"
+  powershell -Command "Get-MpPreference | Select -Expand ExclusionProcess"
+  powershell -Command "Get-MpPreference | Select -Expand ExclusionExtension"
+
+  powershell -Command Remove-MpPreference -ExclusionExtension ".java"
+
 https://support.microsoft.com/en-us/help/4028485/windows-10-add-an-exclusion-to-windows-security
   Add an exclusion to Windows Security.
+https://docs.microsoft.com/en-us/powershell/module/defender/add-mppreference
+  Modifies settings for Windows Defender from PowerShell.
+https://docs.microsoft.com/en-us/powershell/module/defender/remove-mppreference
+  Removes exclusions or default actions.
 
 Exclude directories Windows Search Indexing
 ===========================================