Version detection to skip app install

Topics: Archive - General
Jan 27, 2014 at 2:24 AM
Edited Jan 27, 2014 at 2:26 AM
$InstalledVersion = (Get-InstalledApplication "<Application Name>")
$InstalledVersion = $InstalledVersion.DisplayVersion

If($InstalledVersion -eq $appVersion)
{
        Show-DialogBox -Title "Installation Skipped" -Text "Current version of $appVendor $appName ($appVersion) already installed. " -Icon "Information"
        Exit-Script -ExitCode 0
}