Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save philippdolder/4f21849a0619c0dda512bf60a28726b0 to your computer and use it in GitHub Desktop.
Save philippdolder/4f21849a0619c0dda512bf60a28726b0 to your computer and use it in GitHub Desktop.
Windows Defender configuration for JetBrains Rider
[CmdletBinding()]
param (
[Parameter(Mandatory)]
[string]
$RiderHome
)
function Update-WindowsDefenderForRider {
[CmdletBinding()]
param (
[Parameter(Mandatory)]
[string]
$RiderHome
)
$directories = @()
$directories += Get-ChildItem -Directory -Recurse $RiderHome\bin
$directories += "$($RiderHome)\bin"
$directories += Get-ChildItem -Directory -Recurse $RiderHome\lib\ReSharperHost
$directories += "$($RiderHome)\lib\ReSharperHost"
$directories += Get-ChildItem -Directory -Recurse $RiderHome\tools
$directories | ForEach-Object {
Add-MpPreference -ExclusionProcess "$($_)\*.dll"
Add-MpPreference -ExclusionProcess "$($_)\*.exe"
}
}
Update-WindowsDefenderForRider -RiderHome $RiderHome
@ursenzler
Copy link

Do you really have to exclude the folders recursively?

@philippdolder
Copy link
Author

philippdolder commented Jan 7, 2020

I'm excluding all *.exe and *.dll in any folder recursively, because I didn't find anything in the Windows Defender docs that would allow to exclude processes in folders recursively. Anything like C:\bla\*\*.exe doesn't appear to work when checking their docs.
From all I understood until now: when you exclude a folder it will be recursively, but only very basic wildcard support for processes is available

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment