Bugfix: New-PSDrive seems to return the "hku" itself so weirdly gets prepended to the return value so the result becomes ("hku", $false). In powershell pretty much every variable that exists is interpreted as $true so the toggle for numlock got incorrectly checked

This commit is contained in:
Marterich 2024-11-06 22:58:41 +01:00
parent a4fccd3c85
commit feff1078d8

View File

@ -17,7 +17,7 @@ Function Get-WinUtilToggleStatus {
$ToggleSwitchReg = $sync.configs.tweaks.$ToggleSwitch.registry $ToggleSwitchReg = $sync.configs.tweaks.$ToggleSwitch.registry
if (($ToggleSwitchReg.path -imatch "hku") -and !(Get-PSDrive -Name HKU -ErrorAction SilentlyContinue)) { if (($ToggleSwitchReg.path -imatch "hku") -and !(Get-PSDrive -Name HKU -ErrorAction SilentlyContinue)) {
New-PSDrive -PSProvider Registry -Name HKU -Root HKEY_USERS $null = New-PSDrive -PSProvider Registry -Name HKU -Root HKEY_USERS
write-host "Created HKU drive" write-host "Created HKU drive"
if (Get-PSDrive -Name HKU -ErrorAction SilentlyContinue) { if (Get-PSDrive -Name HKU -ErrorAction SilentlyContinue) {
Write-Host "HKU drive created successfully" -ForegroundColor Green Write-Host "HKU drive created successfully" -ForegroundColor Green