Auto-Enable Numlock on a Hyper-V Guest

Posted on June 28 2023 under windows, powershell, and hyper-v

Run the following in an elevated Powershell prompt:

New-PSDrive -PSProvider Registry -Name HKU -Root HKEY_USERS
Set-ItemProperty -Path "HKU:\.DEFAULT\Control Panel\Keyboard" -Name InitialKeyboardIndicators -Value 2
Set-ItemProperty -Path "HKCU:\Control Panel\Keyboard" -Name InitialKeyboardIndicators -Value 2