From feff1078d8beb3959e866c108529dab8e5e4d4e1 Mon Sep 17 00:00:00 2001 From: Marterich <47688561+Marterich@users.noreply.github.com> Date: Wed, 6 Nov 2024 22:58:41 +0100 Subject: [PATCH] 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 --- functions/private/Get-WinUtilToggleStatus.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functions/private/Get-WinUtilToggleStatus.ps1 b/functions/private/Get-WinUtilToggleStatus.ps1 index 0ac3f208..58a31dee 100644 --- a/functions/private/Get-WinUtilToggleStatus.ps1 +++ b/functions/private/Get-WinUtilToggleStatus.ps1 @@ -17,7 +17,7 @@ Function Get-WinUtilToggleStatus { $ToggleSwitchReg = $sync.configs.tweaks.$ToggleSwitch.registry 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" if (Get-PSDrive -Name HKU -ErrorAction SilentlyContinue) { Write-Host "HKU drive created successfully" -ForegroundColor Green