Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to use Powershell to retrieve info from an .msi.

How to use Powershell to retrieve info from an .msi.


You may want to read info from an existing .msi at times. This can be done with powershell.



The powershell may use a COM Windows installer object. Open the .MSI as a database, use a view to execute a query and fetch the data.

Below is an example of powershell querying the shortcut table of an .msi for values.

Other tables can be queried by changing the select statement in line:
$ShortcutsView = $MSI.OpenView("select * from Shortcut")


Column values can be retrieved from other columns by changing number value in the line:

Write-Output (Get-Property $Shortcuts StringData 1)



$windowsInstaller = New-Object -ComObject WindowsInstaller.Installer

function Get-Property ($Object, $PropertyName, [object[]]$ArgumentList) {
return $Object.GetType().InvokeMember($PropertyName, 'Public, Instance, GetProperty', $null, $Object, $ArgumentList)

$MSI = $windowsInstaller.OpenDatabase("C:\InstallShield 2019 Projects\My Project Name-1\Product Configuration 1\Release 1\DiskImages\DISK1\My Project Name-1.msi", 0)

$ShortcutsView = $MSI.OpenView("select * from Shortcut")

$Shortcuts = $ShortcutsView.Fetch()

write-host "First 5 fields of Shortcut table" -ForegroundColor Green
if ($Shortcuts) {
Write-Output (Get-Property $Shortcuts StringData 1)
Write-Output (Get-Property $Shortcuts StringData 2)
Write-Output (Get-Property $Shortcuts StringData 3)
Write-Output (Get-Property $Shortcuts StringData 4)
Write-Output (Get-Property $Shortcuts StringData 5)



$MSI = $null



Additional Information:
Here is a link to documentation on the COM Windows installer object.

Labels (1)
Was this article helpful? Yes No
No ratings
Version history
Last update:
‎Jul 28, 2020 01:11 PM
Updated by: