From e84398dc28283cf7adafae0e2be4e2cf4baa446d Mon Sep 17 00:00:00 2001 From: Luke Street Date: Tue, 15 Aug 2023 10:35:52 -0400 Subject: [PATCH] Create Add-Exclusion.ps1 for Windows Defender --- Add-Exclusion.ps1 | 15 +++++++++++++++ README.md | 1 + 2 files changed, 16 insertions(+) create mode 100644 Add-Exclusion.ps1 diff --git a/Add-Exclusion.ps1 b/Add-Exclusion.ps1 new file mode 100644 index 0000000..04ba788 --- /dev/null +++ b/Add-Exclusion.ps1 @@ -0,0 +1,15 @@ +Start-Process -Verb RunAs -Wait powershell.exe -Args @" + `$dir=\`"${pwd}\`" + Write-Output \`"Adding exclusion path to Windows Defender: `${dir}\`" + Add-MpPreference -ExclusionPath \`"`${dir}\`" + `$result = if (`$?) + { + \`"Command succeeded\`" + } + else + { + \`"Command failed\`" + } + Write-Output `$result + read-host \`"Press enter to exit\`" +"@ diff --git a/README.md b/README.md index b9dfe51..b1ded19 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,7 @@ Windows: - Install [ninja](https://github.com/ninja-build/ninja/releases) and add it to `%PATH%`. - Install [Python](https://www.python.org/downloads/) and add it to `%PATH%`. - Also available from the [Windows Store](https://apps.microsoft.com/store/detail/python-311/9NRWMJP3717K). +- (Optional) Run `Add-Exclusion.ps1` (Right click -> "Run with PowerShell") to avoid degraded performance from Windows Defender scans. macOS: ------