From 132b0afe09845b8f7d827a034ff07669fdd03cbf Mon Sep 17 00:00:00 2001 From: Simon Baerlocher Date: Thu, 12 Sep 2019 12:37:52 +0200 Subject: [PATCH] fix lint --- scripts/search-Bar.ps1 | 15 +++++++++++++++ tasks/distribution/Windows.yml | 17 +---------------- 2 files changed, 16 insertions(+), 16 deletions(-) create mode 100644 scripts/search-Bar.ps1 diff --git a/scripts/search-Bar.ps1 b/scripts/search-Bar.ps1 new file mode 100644 index 0000000..853eb7e --- /dev/null +++ b/scripts/search-Bar.ps1 @@ -0,0 +1,15 @@ +$Regpath = $Env:SystemDrive + "\Users\Default\NTUSER.DAT" +& REG LOAD HKLM\DEFAULT_USER $Regpath +New-ItemProperty -Path "HKLM:\DEFAULT_USER\Software\Microsoft\Windows\CurrentVersion\Search" -PropertyType DWord -Name "SearchboxTaskbarMode" -Value 0 +& REG UNLOAD HKLM\DEFAULT_USER + +#All users for existing profiles +New-PSDrive -PSProvider Registry -Name HKU -Root HKEY_USERS +$Profiles = Get-ChildItem -Path HKU:\ +foreach ($Profile in $Profiles) { + if ((($Profile.PSChildName).Length -gt 8) -and ($Profile.Name -notlike "*_Classes")) { + $UserRegPath = "HKU:\" + $Profile.PSChildName + "\Software\Microsoft\Windows\CurrentVersion\Search" + New-ItemProperty -Path $UserRegPath -PropertyType DWord -Name "SearchboxTaskbarMode" -Value 0 -ErrorAction SilentlyContinue + } +} +Remove-PSDrive -Name HKU diff --git a/tasks/distribution/Windows.yml b/tasks/distribution/Windows.yml index 530c533..54b5b28 100644 --- a/tasks/distribution/Windows.yml +++ b/tasks/distribution/Windows.yml @@ -114,19 +114,4 @@ script: scripts/Invoke-RemoveBuiltinApps.ps1 - nmae: 'windows : small search Icon' - win_shell: | - $Regpath = $Env:SystemDrive + "\Users\Default\NTUSER.DAT" - & REG LOAD HKLM\DEFAULT_USER $Regpath - New-ItemProperty -Path "HKLM:\DEFAULT_USER\Software\Microsoft\Windows\CurrentVersion\Search" -PropertyType DWord -Name "SearchboxTaskbarMode" -Value 0 - & REG UNLOAD HKLM\DEFAULT_USER - - #All users for existing profiles - New-PSDrive -PSProvider Registry -Name HKU -Root HKEY_USERS - $Profiles = Get-ChildItem -Path HKU:\ - foreach($Profile in $Profiles){ - if((($Profile.PSChildName).Length -gt 8) -and ($Profile.Name -notlike "*_Classes")){ - $UserRegPath = "HKU:\" + $Profile.PSChildName + "\Software\Microsoft\Windows\CurrentVersion\Search" - New-ItemProperty -Path $UserRegPath -PropertyType DWord -Name "SearchboxTaskbarMode" -Value 0 -ErrorAction SilentlyContinue - } - } - Remove-PSDrive -Name HKU + script: scripts/search-Bar.ps1