PowerShell

Retrieve Windows Defender exclusion

Get-MpPreference | Select-Object -Property ExclusionPath -ExpandProperty ExclusionPath

Add Windows Defender exclusion

Add-MpPreference -ExclusionPath "c:\excludeFilder"
Add-MpPreference -ExclusionExtension "txt"