If you use the "old" windows inventory list "Change Or Remove a Program" you can find each software installed with: Name + Publisher + Installed On + Size + Version
I'm trying to obtain the exact same via powershell. My current method is:
$uninstallPath = "\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\"
$uninstallWow6432Path = "\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\"
@(
if (Test-Path "HKLM:$uninstallWow6432Path" ) { Get-ChildItem "HKLM:$uninstallWow6432Path"}
if (Test-Path "HKLM:$uninstallPath" ) { Get-ChildItem "HKLM:$uninstallPath" }
if (Test-Path "HKCU:$uninstallWow6432Path") { Get-ChildItem "HKCU:$uninstallWow6432Path"}
if (Test-Path "HKCU:$uninstallPath" ) { Get-ChildItem "HKCU:$uninstallPath" }
) |
ForEach-Object { Get-ItemProperty $_.PSPath } |
Where-Object {
$_.DisplayName -and !$_.SystemComponent -and !$_.ReleaseType -and !$_.ParentKeyName -and ($_.UninstallString -or $_.NoRemove)
} |
Sort-Object DisplayName |
ForEach-Object -Process {
echo "$($_.DisplayName);$($_.DisplayVersion);$($_.InstallDate)"
}
The main issue I have now, is some Softwares are missing the key "Installed On" (but that value is present on the "Change or Remove a program" page)
Is there a way to get a like for like inventory list?
Other options I have tried:
- Get-WmiObject -Class Win32_Product -> not recommended, see PowerShell for Software Inventory
- get-package