Error retrieving registry value with Powershell -
I'm trying to read a value from a registry entry with Pavarseld it is quite simple, however, a special The registry key is giving me trouble.
If I run the following, then I can not get the value of "$ setting" (default).
C: \ Program Files \ PowerGUI & gt; Get $ set = a ItemProperty -Path "HKLM: \ SOFTWARE Microsoft \ Windows NT \ CurrentVersion \ IniFileMapping \ Autorun.inf \" C: \ Program Files \ PowerGUI & gt; $ Settings PSPath: Microsoft.PowerShell.Core \ Registry :: HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ Windows NT \ CurrentVersion \ IniFileMapping \ Autorun.inf PSParentPath: Microsoft.PowerShell.Core \ Registry :: Microsoft \ Windows NT \ CurrentVersion \ HKEY_LOCAL_MACHINE \ SOFTWARE \ IniFileMapping PSChildName: Autorun.inf PSDrive: HKLM PSProvider: Microsoft.PowerShell.Core \ registry (default): @SYS: DoesNotExist $ normally, I would do setting.Attribute , Or $ setting. (Default). However, results in the following error:
C: \ Program Files \ PowerGUI & gt; $ Setting (Default) the word 'default' is not recognized as a Simdilet, function, operative program or script file. Confirm the word and try again. In: Line: 1 character:. 17 + $ setting (By default How do I get the value of "(default)" attribute
Thanks in advance.
edit was to see through and the old script find out for. The trick is that you need to look inside you built Pisobaij to achieve values. Look at the specialty bags on the special
$ one = get-ItemProperty-path "HKLM: \ some \ path" $ default = $ a.psobject.Properties | ? {$ _. You can also use an indexer instead of just doing the filter instead of the name -eq "(default)"}
$$ .psobject.Properties ["(default)"]. Values;
Comments
Post a Comment