PowerShell: Get the MSI product code out of a MSI file without installing?
问题 Is there a possibility to retreive the MSI product code out of a MSI file without installing it with PowerShell? I want to compare the product code of a MSI file with the MSI codes installed on a maschine to find out if the file was installed in the past. 回答1: Here is a script that reads the product code based on this article: $path = "pathto.msi" $comObjWI = New-Object -ComObject WindowsInstaller.Installer $MSIDatabase = $comObjWI .GetType().InvokeMember("OpenDatabase","InvokeMethod",$Null,