So, I need to automatically disable Windows Defender for certain virtual machines via a PowerShell script. Previous to the May update, one could set the DisableAntiSpyware and
:: Disable Windows Defender with Group Policy.
Reg.exe add "HKLM \ SOFTWARE \ Policies \ Microsoft \ Windows Defender" / v "DisableAntiSpyware" / t REG_DWORD / d "1" / f> Nul
Reg.exe add "HKLM \ SOFTWARE \ Policies \ Microsoft \ Windows Defender \ Real-Time Protection" / v "DisableBehaviorMonitoring" / t REG_DWORD / d "1" / f> Nul
Reg.exe add "HKLM \ SOFTWARE \ Policies \ Microsoft \ Windows Defender \ Real-Time Protection" / v "DisableOnAccessProtection" / t REG_DWORD / d "1" / f> Nul
Reg.exe add "HKLM \ SOFTWARE \ Policies \ Microsoft \ Windows Defender \ Real-Time Protection" / v "DisableScanOnRealtimeEnable" / t REG_DWORD / d "1" / f> Nul
Reg.exe add "HKLM \ SOFTWARE \ Policies \ Microsoft \ Windows Defender \ Real-Time Protection" / v "DisableRealtimeMonitoring" / t REG_DWORD / d "1" / f> Nul
Cls & Mode CON LINES = 5 COLS = 49 & Color 0E & Title - WARNING -
Echo.
Echo.
Echo Windows Defender Disabled
Ping -n 5 localhost> Nul
Cls
Goto: Reboot