xf.is Blog   Archives  About

View CPU microcode revision from powershell

2018-06-28

A small powershell snippet to show what CPU microcode revision is running and what microcode revision the BIOS provides.

$registrypath = "Registry::HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\CentralProcessor\0\"

$processor = (Get-ItemProperty -Path $registrypath )."ProcessorNameString"
$biosMicrocode = (Get-ItemProperty -Path $registrypath )."Previous Update Revision"
$runningMicrocode = (Get-ItemProperty -Path $registrypath )."Update Revision"

# Convert to string and remove leading zeros
$biosMicrocodeInHex = (-join ( $biosMicrocode[0..4] | foreach { $_.ToString("X2") } )).TrimStart('0')
$runningMicrocodeInHex = (-join ( $runningMicrocode[0..4] | foreach { $_.ToString("X2") } )).TrimStart('0')

Write-Host "CPU: $processor"
Write-Host "BIOS microcode revision: 0x$biosMicrocodeInHex"
Write-Host "Current microcode revision: 0x$runningMicrocodeInHex"

Example output:

CPU: Intel(R) Core(TM) i7-2600K CPU @ 3.40GHz
BIOS microcode version:  0x28
Current microcode running: 0x2D