Forked from nerzhulart/Windows Defender Exclusions for Developer.ps1
Last active
November 24, 2021 10:21
-
-
Save oikonomopo/e32abe37ecb523539697e8a23c4f826b to your computer and use it in GitHub Desktop.
Adds Windows Defender exclusions for java web developers using IntelliJ IDEA IDE (#intellij-idea, #java, #maven, #jrebel, #git etc.)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $userPath = $env:USERPROFILE | |
| $pathExclusions = New-Object System.Collections.ArrayList | |
| $processExclusions = New-Object System.Collections.ArrayList | |
| # Maven: default local repository (%USERPROFILE%\.m2) | |
| $pathExclusions.Add($userPath + '\.m2') > $null | |
| # JRebel: default home folder (%USERPROFILE%\.jrebel) | |
| $pathExclusions.Add($userPath + '\.jrebel') > $null | |
| # Text editors | |
| # VS Code | |
| $processExclusions.Add('Code.exe') > $null | |
| # Sublime Text 3 | |
| # $processExclusions.Add('sublime_text.exe') > $null | |
| # Notepad++ | |
| # $processExclusions.Add('notepad++.exe') > $null | |
| # Runtimes, build tools | |
| $processExclusions.Add('java.exe') > $null | |
| $processExclusions.Add('javaw.exe') > $null | |
| $processExclusions.Add('node.exe') > $null | |
| $processExclusions.Add('node.js') > $null | |
| # VCS | |
| $processExclusions.Add('git.exe') > $null | |
| # Shells | |
| $processExclusions.Add('git-bash.exe') > $null | |
| $processExclusions.Add('bash.exe') > $null | |
| $processExclusions.Add('powershell.exe') > $null | |
| # All of JetBrains stuff | |
| # IntelliJ IDEA IDE | |
| $processExclusions.Add('idea.exe') > $null | |
| $processExclusions.Add('idea64.exe') > $null | |
| $processExclusions.Add('fsnotifier.exe') > $null | |
| $processExclusions.Add('fsnotifier64.exe') > $null | |
| $processExclusions.Add('runnerw.exe') > $null | |
| $processExclusions.Add('runnerw64.exe') > $null | |
| # JB Toolbox | |
| $processExclusions.Add('jetbrains-toolbox.exe') > $null | |
| $processExclusions.Add('jetbrains-toolbox-cef.exe') > $null | |
| $processExclusions.Add('jetbrains-toolbox-cef-helper.exe') > $null | |
| Write-Host "This script will create Windows Defender exclusions for common IntelliJ IDEA folders and processes." | |
| Write-Host "" | |
| $projectsFolder = Read-Host 'What is the path to your Projects folder? (example: c:\projects)' | |
| Write-Host "" | |
| Write-Host "Adding Path Exclusion: " $projectsFolder | |
| Add-MpPreference -ExclusionPath $projectsFolder | |
| foreach ($exclusion in $pathExclusions) | |
| { | |
| Write-Host "Adding Path Exclusion: " $exclusion | |
| Add-MpPreference -ExclusionPath $exclusion | |
| } | |
| foreach ($exclusion in $processExclusions) | |
| { | |
| Write-Host "Adding Process Exclusion: " $exclusion | |
| Add-MpPreference -ExclusionProcess $exclusion | |
| } | |
| Write-Host "" | |
| Write-Host "Your Exclusions:" | |
| $prefs = Get-MpPreference | |
| $prefs.ExclusionPath | |
| $prefs.ExclusionProcess | |
| Write-Host "" | |
| Write-Host "Enjoy faster build times and coding!" | |
| Write-Host "" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment