Getting registry key value using powershell

KC2TC
KC2TC used Ask the Experts™
on
I want a powershell script to retrieve a value from a registry key. I am using Get-Item property  $regkey -name $name

It gives me fewlines (6 lines) at the end .and then the value

Can you help me to take only the value of the particular valuename,so that I can check the value using if condition.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Most Valuable Expert 2013
Awarded 2012
Commented:
Hi,

should be
(Get-ItemProperty $regkey $key).$key

Sample:
 (Get-ItemProperty "HKLM:\Software\Microsoft\Windows NT\CurrentVersion" CurrentBuild).CurrentBuild
returns

7600

HTH
Rainer
KC2TCApplication Repackaging

Author

Commented:
Thank you. It works!!

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial