PowerShell Check Application Version

  • Welcome to ITBible, we're your #1 resource for enterprise or homelab IT problems (or just a place to show off your stuff).

WizardTux

Administrator
Staff member
Diamond Supporter
Partner
TCC-OG
Network Engineer
Sep 22, 2022
187
14
153
Shawnee, Kansas, USA
itbible.org
Simple way to get the version of an application via PowerShell.

PowerShell:
Param(
    [Parameter(Mandatory=$true)]
    $ApplicationName
)

$InstalledSoftware = Get-ChildItem "HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall"

if($ApplicationName -ne $null) {
    foreach($obj in $InstalledSoftware) {
        if($obj.GetValue('DisplayName') -eq $ApplicationName) {
            write-host $obj.GetValue('DisplayVersion')
        }
    }
} else {
    foreach($obj in $InstalledSoftware) {
        write-host $obj.GetValue('DisplayName') -NoNewline; write-host " - " -NoNewline; write-host $obj.GetValue('DisplayVersion')
    }
}