This modules consists of several functions for handling MSI files.
Install-Module MsiHandler
Import-Module MsiHandlerThis function will read the properties out of an MSI file without locking the specified file.
The MSI file's [IO.FileInfo] is returned as the .IO.FileInfo property.
Here's the default usage:
Get-MsiFileInfo -Path 'C:\Temp\SurfaceBook_Win10_15063_1802100_0.msi'Output:
.IO.FileInfo    : C:\Temp\SurfaceBook_Win10_15063_1802100_0.msi
Manufacturer    : Microsoft
ProductCode     : {1CD69D1F-0C2D-46A0-89A9-F29582DC718F}
ProductLanguage : 1033
ProductName     : SurfaceBook Update 18_021_00 (64 bit)
ProductVersion  : 18.021.18206.0
Full usage documentations available in the wiki.
Create an MST file on the fly.
$newMsiTransformFile = @{
    MsiPath      = 'dev\TestMSIs\7z1900-x64.msi'
    MstPath      = 'dev\test.mst'
    Properties = @{
        ALLUSERS           = 'ValueChanged'
        MSIRMSHUTDOWN      = 'ValueChanged'
        SOMETHINGTOADD     = 'ValueAdded'
        SOMETHINGELSETOADD = 'ValueAdded'
    }
}
New-MsiTransformFile @newMsiTransformFileOutput:
Mode                LastWriteTime         Length Name
----                -------------         ------ ----
-a----        2/28/2019   3:46 AM          20480 test.mst