registry keys in variables

Hi,

i´m trying to read some keys from the registry, save them in a variable for using them.
(scanning a complete network for installed Programs, this is only a small part of it)

$varName = Get-ChildItem HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall | select Name;
$varName;
foreach ($Prog in $Varname){
    get-childitem $Prog | select Name
}

for me as a PS beginner i can´t imagine why there is ny working path in front of the $Prog when using it in foreach f.e. c:\Windows\system32@{Name=hklm…

I hope you can help me

Andreas

If you do not specify a complete path Powershell uses the current directory to complete the path. If I got you right you#re looking for something like this:

$varName = Get-ChildItem HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\ 
foreach ($Prog in $Varname){
Get-ItemProperty $Prog.PSPath
}

or this
Get-ChildItem HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall*</pre>

The one solution with $Prog.PSPath is the one i was looking for :slight_smile: thx
I need to know all installed software its display name and version nummer and now i can get it