Reading Registry Values Easily

by Jul 10, 2014

All PowerShell versions

Here is the simplest way to read Registry values:

$Key = 'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion'
$Name = 'RegisteredOwner'

$result = (Get-ItemProperty -Path "Registry::$Key" -ErrorAction Stop).$Name


"Registered Windows Owner: $result"

Simply replace the $Key with the Registry key and $Name with the Registry value to read the value.

Twitter This Tip! ReTweet this Tip!