Reading Registry Values the Easy Way

by Jun 19, 2014

With PowerShell, it can be a piece of cake to read out Registry values. Here is your simple code template:

$RegPath = 'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion'
$key = Get-ItemProperty -Path "Registry::$RegPath"

Now, simply replace the value of $RegPath with any Registry key path. You can even copy and paste the key path from regedit.exe.

Once you run the code and $key is filled, simply enter $key and a dot. In the ISE editor, IntelliSense will show all value names of that key, and you can simply pick the ones you want to read. In the console, press TAB after you entered the "." to see the available value names:

$key.CommonFilesDir
$key.MediaPathUnexpanded
$key.ProgramW6432Dir 

Twitter This Tip! ReTweet this Tip!