Fix Numlock on startup

Fix Numlock on startup
This commit is contained in:
Chris Titus 2024-08-06 13:41:31 -05:00
parent ab6898aebc
commit 31aedcf684

View File

@ -16,8 +16,10 @@ function Invoke-WinUtilNumLock {
$value = 0 $value = 0
} }
New-PSDrive -PSProvider Registry -Name HKU -Root HKEY_USERS New-PSDrive -PSProvider Registry -Name HKU -Root HKEY_USERS
$Path = "HKU:\.Default\Control Panel\Keyboard" $HKUPath = "HKU:\.Default\Control Panel\Keyboard"
Set-ItemProperty -Path $Path -Name InitialKeyboardIndicators -Value $value $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] { Catch [System.Security.SecurityException] {
Write-Warning "Unable to set $Path\$Name to $Value due to a Security Exception" Write-Warning "Unable to set $Path\$Name to $Value due to a Security Exception"