Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 8 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • 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
@philippdolder
Copy link
Author

philippdolder commented Jan 6, 2020

The value for $RiderHome can be found by following the docs https://rider-support.jetbrains.com/hc/en-us/articles/360006365380#h_fe327f48-579b-4073-b207-b7c6d67ff054

Note: only .exe and .dll from the 3 folders specified for Process exclusions. msbuild.exe and folder exclusions is already done by Rider

@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