From 31aedcf6847d615ea33e341b196b142bd4794a2e Mon Sep 17 00:00:00 2001 From: Chris Titus Date: Tue, 6 Aug 2024 13:41:31 -0500 Subject: [PATCH] Fix Numlock on startup Fix Numlock on startup --- functions/private/Invoke-WinUtilNumLock.ps1 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/functions/private/Invoke-WinUtilNumLock.ps1 b/functions/private/Invoke-WinUtilNumLock.ps1 index 97b36a94..d625b033 100644 --- a/functions/private/Invoke-WinUtilNumLock.ps1 +++ b/functions/private/Invoke-WinUtilNumLock.ps1 @@ -16,8 +16,10 @@ function Invoke-WinUtilNumLock { $value = 0 } New-PSDrive -PSProvider Registry -Name HKU -Root HKEY_USERS - $Path = "HKU:\.Default\Control Panel\Keyboard" - Set-ItemProperty -Path $Path -Name InitialKeyboardIndicators -Value $value + $HKUPath = "HKU:\.Default\Control Panel\Keyboard" + $HKCUPath = "HKCU:\Control Panel\Keyboard" + Set-ItemProperty -Path $HKUPath -Name InitialKeyboardIndicators -Value $value + Set-ItemProperty -Path $HKCUPath -Name InitialKeyboardIndicators -Value $value } Catch [System.Security.SecurityException] { Write-Warning "Unable to set $Path\$Name to $Value due to a Security Exception"