It appears that checking MSI version in PowerShell is much less trivial than checking DLL version. Yet, the following script can do it for you. Most of the credits for the script go to this StackOverflow question.
############################################################### # Name: GetMsiVersion.ps1 # Description: Prints out MSI installer version # Usage: GetMsiVersion.ps1 <path to MSI> # Credits: http://stackoverflow.com/q/8743122/383673 ############################################################### param ( [IO.FileInfo] $MSI ) if (!(Test-Path $MSI.FullName)) { throw "File '{0}' does not exist" -f $MSI.FullName } try { $windowsInstaller = New-Object -com WindowsInstaller.Installer $database = $windowsInstaller.GetType().InvokeMember( "OpenDatabase", "InvokeMethod", $Null, $windowsInstaller, @($MSI.FullName, 0) ) $q = "SELECT Value FROM Property WHERE Property = 'ProductVersion'" $View = $database.GetType().InvokeMember( "OpenView", "InvokeMethod", $Null, $database, ($q) ) $View.GetType().InvokeMember("Execute", "InvokeMethod", $Null, $View, $Null) $record = $View.GetType().InvokeMember( "Fetch", "InvokeMethod", $Null, $View, $Null ) $version = $record.GetType().InvokeMember( "StringData", "GetProperty", $Null, $record, 1 ) return $version } catch { throw "Failed to get MSI file version: {0}." -f $_ }
Here is the execution sample:
C:\>powershell -ExecutionPolicy bypass -File GetMsiVersion.ps1 "C:\Program Files (x86)\Google\Update\1.3.21.79\GoogleUpdateHelper.msi" 1.3.21.79 C:\>
Enjoy!