1

I'm trying to figure how to view the version numbers of all installed software in Powershell on Windows 10. I dug up an example but when I compare the generated list to what's in Control Panel > Uninstall a Program, it seems incomplete. For instance, Google Chrome is missing from the query output. Any idea why? I have very little experience with Powershell so maybe something obvious?

Get-WMIObject -Query "SELECT * FROM Win32_Product" |FT

Chrome is certainly installed but doesn't show up in the PS output: enter image description here

2
  • Win32_Product will provide information on Windows Installer managed applications. Vendors aren't required to use Windows Installer, they may have their own installer. Additionally, many applications don't have an installer. Just copy the file(s). There is a reason there are companies that have products that audit and inventory applications.
    – Greg Askew
    Sep 23, 2022 at 16:29
  • Which products in particular are you thinking about? If you know of a solution which actually works as-advertised I'd love to try it out.
    – Nstevens
    Sep 24, 2022 at 11:08

1 Answer 1

2

Try this:

function Get-InstalledApps {
    param (
        [Parameter(ValueFromPipeline=$true)]
        [string[]]$ComputerName = $env:COMPUTERNAME,
        [string]$NameRegex = ''
    )
    
    foreach ($comp in $ComputerName) {
        $keys = '','\Wow6432Node'
        foreach ($key in $keys) {
            try {
                $reg = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey('LocalMachine', $comp)
                $apps = $reg.OpenSubKey("SOFTWARE$key\Microsoft\Windows\CurrentVersion\Uninstall").GetSubKeyNames()
            } catch {
                continue
            }

            foreach ($app in $apps) {
                $program = $reg.OpenSubKey("SOFTWARE$key\Microsoft\Windows\CurrentVersion\Uninstall\$app")
                $name = $program.GetValue('DisplayName')
                if ($name -and $name -match $NameRegex) {
                    [pscustomobject]@{
                        ComputerName = $comp
                        DisplayName = $name
                        DisplayVersion = $program.GetValue('DisplayVersion')
                        Publisher = $program.GetValue('Publisher')
                        InstallDate = $program.GetValue('InstallDate')
                        UninstallString = $program.GetValue('UninstallString')
                        Bits = $(if ($key -eq '\Wow6432Node') {'64'} else {'32'})
                        Path = $program.name
                    }
                }
            }
        }
    }
}

Use: Get-InstalledApps -ComputerName $env:COMPUTERNAME

1
  • This captures Chrome, as well as Adobe Acrobat. Thank you!
    – Nstevens
    Sep 24, 2022 at 11:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.