Check Application Version

Simple way to get the version of an application via 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')
    }
}