From bd74255b816b5940883e28fef7702733a4ea965b Mon Sep 17 00:00:00 2001 From: Alex Hirsch Date: Mon, 4 Jul 2016 14:52:42 +0200 Subject: [PATCH] Fix line endings in disable-windows-defender.ps1 --- scripts/disable-windows-defender.ps1 | 56 ++++++++++++++-------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/scripts/disable-windows-defender.ps1 b/scripts/disable-windows-defender.ps1 index b35319d..a6cf92d 100644 --- a/scripts/disable-windows-defender.ps1 +++ b/scripts/disable-windows-defender.ps1 @@ -1,28 +1,28 @@ -# Description: -# This script disables Windows Defender. - -$tasks = @( - "\Microsoft\Windows\Windows Defender\Windows Defender Cache Maintenance" - "\Microsoft\Windows\Windows Defender\Windows Defender Cleanup" - "\Microsoft\Windows\Windows Defender\Windows Defender Scheduled Scan" - "\Microsoft\Windows\Windows Defender\Windows Defender Verification" -) - -foreach ($task in $tasks) { - $parts = $task.split('\') - $name = $parts[-1] - $path = $parts[0..($parts.length-2)] -join '\' - - echo "Trying to disable scheduled task $name" - Disable-ScheduledTask -TaskName "$name" -TaskPath "$path" -} - -echo "Disabling Windows Defender via Group Policies" -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 - -echo "Removing Windows Defender context menu item" -si "HKLM:\SOFTWARE\Classes\CLSID\{09A47860-11B0-4DA5-AFA5-26D86198A780}\InprocServer32" "" +# Description: +# This script disables Windows Defender. + +$tasks = @( + "\Microsoft\Windows\Windows Defender\Windows Defender Cache Maintenance" + "\Microsoft\Windows\Windows Defender\Windows Defender Cleanup" + "\Microsoft\Windows\Windows Defender\Windows Defender Scheduled Scan" + "\Microsoft\Windows\Windows Defender\Windows Defender Verification" +) + +foreach ($task in $tasks) { + $parts = $task.split('\') + $name = $parts[-1] + $path = $parts[0..($parts.length-2)] -join '\' + + echo "Trying to disable scheduled task $name" + Disable-ScheduledTask -TaskName "$name" -TaskPath "$path" +} + +echo "Disabling Windows Defender via Group Policies" +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 + +echo "Removing Windows Defender context menu item" +si "HKLM:\SOFTWARE\Classes\CLSID\{09A47860-11B0-4DA5-AFA5-26D86198A780}\InprocServer32" ""