mirror of
https://github.com/zoicware/RemoveWindowsAI.git
synced 2025-12-17 07:06:29 +01:00
dont clobber settings visibility tweak fix #42
This commit is contained in:
@@ -1471,9 +1471,17 @@ function Hide-AI-Components {
|
||||
if ($revert) {
|
||||
Reg.exe delete 'HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer' /v 'SettingsPageVisibility' /f >$null
|
||||
}
|
||||
else {
|
||||
$existingSettings = Get-ItemPropertyValue 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer' -Name 'SettingsPageVisibility' -ErrorAction SilentlyContinue
|
||||
if ($existingSettings) {
|
||||
$newval = $existingSettings + 'aicomponents;'
|
||||
Reg.exe add 'HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer' /v 'SettingsPageVisibility' /t REG_SZ /d $newval /f >$null
|
||||
}
|
||||
else {
|
||||
Reg.exe add 'HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer' /v 'SettingsPageVisibility' /t REG_SZ /d 'hide:aicomponents;' /f >$null
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
function Disable-Notepad-Rewrite {
|
||||
|
||||
Reference in New Issue
Block a user