This script lists the installed products on a machine by reading the registry. The complexity in the script is to deal with the variations in the way that some scripts store there uninstall data in the registry. This script may work better than some scripts that use WMI.
$registryKeys = get-childitem -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
foreach ($registryKey in $registryKeys)
$displayName = $registryKey.GetValue("DisplayName")
if ($displayName -eq $null)
$displayName = $registryKey.MshChildName