From b159c7452bffbd35f10a4bc489e5f5343828439f Mon Sep 17 00:00:00 2001 From: Alex Hirsch Date: Sat, 22 Aug 2015 18:22:24 +0200 Subject: [PATCH] remove reg-import from defender --- scripts/disable-defender.ps1 | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/scripts/disable-defender.ps1 b/scripts/disable-defender.ps1 index bfcb2bd..1a4181b 100644 --- a/scripts/disable-defender.ps1 +++ b/scripts/disable-defender.ps1 @@ -1,16 +1,9 @@ # Description: # This script will disable Windows Defender via Group Policies. -Import-Module -DisableNameChecking $PSScriptRoot\..\lib\reg-helper.psm1 - echo "Disabling Windows Defender" -Import-Registry(@" -[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows Defender] -"DisableAntiSpyware"=dword:00000001 -"DisableRoutinelyTakingAction"=dword:00000001 - -[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows Defender\Policy Manager] - -[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows Defender\Real-Time Protection] -"DisableRealtimeMonitoring"=dword:00000001 -"@) +mkdir -Force "HKLM:\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows Defender" +sp "HKLM:\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows Defender" "DisableAntiSpyware" 1 +sp "HKLM:\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows Defender" "DisableRoutinelyTakingAction" 1 +mkdir -Force "HKLM:\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows Defender\Real-Time Protection" +sp "HKLM:\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows Defender\Real-Time Protection" "DisableRealtimeMonitoring" 1