add trailing semi colon fix #69

This commit is contained in:
zoicware
2025-12-10 13:13:53 -05:00
committed by GitHub
parent 17d1982df5
commit 179db55fec

View File

@@ -1636,7 +1636,15 @@ function Hide-AI-Components {
} }
else { else {
if ($existingSettings -and $existingSettings -notlike '*aicomponents;*') { if ($existingSettings -and $existingSettings -notlike '*aicomponents;*') {
if (!($existingSettings.endswith(';'))) {
#doesnt have trailing ; so need to add it
$newval = $existingSettings + ';aicomponents;'
}
else {
$newval = $existingSettings + 'aicomponents;' $newval = $existingSettings + 'aicomponents;'
}
Reg.exe add 'HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer' /v 'SettingsPageVisibility' /t REG_SZ /d $newval /f >$null Reg.exe add 'HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer' /v 'SettingsPageVisibility' /t REG_SZ /d $newval /f >$null
} }
elseif ($existingSettings -eq $null) { elseif ($existingSettings -eq $null) {