footech
asked on
Retrieving registry values with Get-ItemProperty
Regarding registry queries, I've often seen the advice that you need to specify the name of the property with get-itemproperty, and then use the property name again using the dot method to retrieve the value. For example:
However, in my experience there's no need to supply the name twice. The below works just fine.
I was wondering if anyone knew some background on this and whether there are any circumstances where my method wouldn't work. It's been tested with both PS 2.0 and 3.0, don't know about 1.0. I can't understand why the previous advice prevails when it doesn't seem to be needed.
(Get-ItemProperty HKLM:\SOFTWARE\Intel\Infinst -name Infver).Infver
However, in my experience there's no need to supply the name twice. The below works just fine.
(Get-ItemProperty HKLM:\SOFTWARE\Intel\Infinst).Infver
I was wondering if anyone knew some background on this and whether there are any circumstances where my method wouldn't work. It's been tested with both PS 2.0 and 3.0, don't know about 1.0. I can't understand why the previous advice prevails when it doesn't seem to be needed.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
If we could use get-itemproperty remotely, the potential impact would be noticable - if there is any.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I appreciate the feedback guys!
ASKER