My output is empty / blank, see belwo.
The example is missing the trailing slash after Uninstall. I get different software lists when I look at the 32/64 bit entries.
Get-ItemProperty HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\* | sort-object -property DisplayName | Select-Object DisplayName, DisplayVersion, Publisher, InstallDate | Format-Table –AutoSize
Get-ItemProperty HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\* | sort-object -property DisplayName | Select-Object DisplayName, DisplayVersion, Publisher, InstallDate | Format-Table –AutoSize
For a combined view, run this.
function Analyze( $p, $f) {
Get-ItemProperty $p |foreach {
if (($_.DisplayName) -or ($_.version)) {
[PSCustomObject]@{
From = $f;
Name = $_.DisplayName;
Version = $_.DisplayVersion;
Install = $_.InstallDate
}
}
}
}
$s = @()
$s += Analyze 'HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*' 64
$s += Analyze 'HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*' 32
$s | Sort-Object -Property Name
Instead of WMIC, try Get-CimInstance
Get-CimInstance Win32_Product | Sort-Object -property Name | Format-Table -Property Version, InstallDate, Name
One behavior I have noticed is that referencing Win32_Product generates an event for each product in the application event log. Check your log. You might be getting an error that is stopping the analysis.
Log Name: Application
Source: MsiInstaller
Date: 2/2/2021 10:06:39 AM
Event ID: 1035
Task Category: None
Level: Information
Keywords: Classic
User: SYSTEM
Computer: slick
Description:
Windows Installer reconfigured the product. Product Name: Microsoft SQL Server 2014 Management Objects. Product Version: 12.0.2000.8. Product Language: 1033. Manufacturer: Microsoft Corporation. Reconfiguration success or error status: 0.