Create Add-Exclusion.ps1 for Windows Defender

This commit is contained in:
Luke Street 2023-08-15 10:35:52 -04:00
parent b38ee2cdc5
commit e84398dc28
2 changed files with 16 additions and 0 deletions

15
Add-Exclusion.ps1 Normal file
View File

@ -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\`"
"@

View File

@ -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:
------