I have a POWERSHELL script to check the presence of a predefined list of software:
$SoftList = "Microsoft Visual C++ 2005 Redistributable","TotoInexistant","GIMP 2.6.11"
define the list of software im looking to check.
i use a loop to compare the name of each software in the list above to resut of cmdlet as follow :
foreach($i in $SoftList)
{
$x = Get-ItemProperty HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\* |
select DisplayName, Publisher, InstallDate | Where-Object {$_.DisplayName -like $i}
$x
$x.DisplayName >> ListOf.txt # or we can to display it on screen
}
the probleme i'm facing is that the $x.DisplayName does not write the name for "Microsoft Visual C++ 2005 Redistributable". how can extract the software name from the $x variable ?