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
}
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"