From 82dbbd654cdc1ecff3288ebf78f5be0b065e8825 Mon Sep 17 00:00:00 2001 From: Alex Hirsch Date: Sat, 22 Aug 2015 19:02:16 +0200 Subject: [PATCH] remove reg-import from optimize update --- scripts/optimize-windows-update.ps1 | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/scripts/optimize-windows-update.ps1 b/scripts/optimize-windows-update.ps1 index c705127..5e50753 100644 --- a/scripts/optimize-windows-update.ps1 +++ b/scripts/optimize-windows-update.ps1 @@ -2,22 +2,16 @@ # This script optimizes Windows updates by disabling automatic download and # seeding updates to other computers. -Import-Module -DisableNameChecking $PSScriptRoot\..\lib\reg-helper.psm1 - echo "Disable automatic download and installation of Windows updates" -Import-Registry(@" -[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows\WindowsUpdate\AU] -"NoAutoUpdate"=dword:00000000 -"AUOptions"=dword:00000002 -"ScheduledInstallDay"=dword:00000000 -"ScheduledInstallTime"=dword:00000003 -"@) +mkdir -Force "HKLM:\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows\WindowsUpdate\AU" +sp "HKLM:\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows\WindowsUpdate\AU" "NoAutoUpdate" 0 +sp "HKLM:\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows\WindowsUpdate\AU" "AUOptions" 2 +sp "HKLM:\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows\WindowsUpdate\AU" "ScheduledInstallDay" 0 +sp "HKLM:\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows\WindowsUpdate\AU" "ScheduledInstallTime" 3 echo "Disable seeding of updates to other computers via Group Policies" -Import-Registry(@" -[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeliveryOptimization] -"DODownloadMode"=dword:00000000 -"@) +mkdir -Force "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DeliveryOptimization" +sp "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DeliveryOptimization" "DODownloadMode" 0 #echo "Disabling automatic driver update" -#Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DriverSearching" -Name "SearchOrderConfig" -Value 0 +#sp "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DriverSearching" "SearchOrderConfig" 0