Read Registry Values

You will find that reading Registry values is not always easy because the Registry is accessible only via the generic "drive" paradigm. Here is a function you can use to read registry values:

Function Get-RegistryValue($key, $value) {
Get-ItemProperty "Registry::$key" $value |
Select-Object -expandProperty $value
}

You should use it like this:

Get-RegistryValue 'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion' ProductID

Twitter This Tip! ReTweet this Tip!


Posted Mar 31 2010, 08:00 AM by ps1

Comments

c.ashwinreddy wrote re: Read Registry Values
on 03-08-2012 10:51 PM

Is there a way to ready the registry value on the remote computer.

I'm looking for away to see if the Auto updates feature is enabled on all the servers. I want to use Powershell to generate a report for this. Is there a way to peform this

Concentrated Tech NSoftware Dell Compellent Sponsored by Idera and Concentrated Tech and NSoftware and Dell Compellent
Copyright 2011 PowerShell.com. All rights reserved.