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…
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:
The one solution with $Prog.PSPath is the one i was looking for thx
I need to know all installed software its display name and version nummer and now i can get it