diff --git a/scripts/disable-searchfeatures.ps1 b/scripts/disable-searchfeatures.ps1 index 6c11440..2a29b5a 100644 --- a/scripts/disable-searchfeatures.ps1 +++ b/scripts/disable-searchfeatures.ps1 @@ -1,10 +1,8 @@ # Description: # This script will disable certain unwanted startmenu search features. -if (-Not (Get-Item -Path "HKLM:\Software\Policies\Microsoft\Windows\Windows Search\" -ErrorAction SilentlyContinue)) { - New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search\" -} -Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search\" -Name AllowCortana -Value 0 -Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search\" -Name DisableWebSearch -Value 1 -Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search\" -Name AllowSearchToUseLocation -Value 0 -Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search\" -Name ConnectedSearchUseWeb -Value 0 +mkdir -Force "HKLM:\Software\Policies\Microsoft\Windows\Windows Search" +sp "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search\" AllowCortana 0 +sp "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search\" DisableWebSearch 1 +sp "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search\" AllowSearchToUseLocation 0 +sp "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search\" ConnectedSearchUseWeb 0