Check Installed Application Versions (Current + Old)

Good afternoon,

I wanted to see if someone would be able to help with something. I am utilizing the Get-InstalledApplication function to query what versions are installed on a machine. What I want to be able to do is install an application only if the current version is not found or if an old version is found also if the current version is installed. Ex: Adobe Flash/Java You can have the current version and older versions installed. In that case I would want to wipe Adobe Flash entirely off the box and only install the new one.

I was looking under the hood within AppDeployToolkitMain.ps1 to see if I could salvage something to facilitate this but to no avail.

Any thought?

[version]$adobeFlashVersion = Get-InstalledApplication “Adobe Flash” | select DisplayVersion -expand DisplayVersion

If ($adobeFlashVersion -lt [version]“19.0.0.226” -or $adobeFlashVersion -eq $null) {
Execute-MSI -Action Install -Path “install_flash_player_11_plugin.msi”
}

Thank-you for your response Sean! And I apologize for my delayed response. I will work on this and let you know the outcome.