Querying a key
An existing value, for example the value of
PATH
in the registry key
HKCU:\Environment, can be queried like so:
PS C:\> get-itemProperty HKCU:\Environment PATH
Unfortunately, this also prints varios PS*
members like PSPath
etc:
Path : C:\Users\Rene\bin/scripts;…
PSPath : Microsoft.PowerShell.Core\Registry::HKEY_CURRENT_USER\Environment
PSParentPath : Microsoft.PowerShell.Core\Registry::HKEY_CURRENT_USER
PSChildName : Environment
PSDrive : HKCU
PSProvider : Microsoft.PowerShell.Core\Registry
PS C:\> get-itemPropertyValue HKCU:\Environment PATH