In order to find the PatchCodeGUID I use a script:

$vbsCode = @" Set msi = CreateObject("WindowsInstaller.Installer") Set patchlist = msi.Patches("{786970C5-E6F6-4A41-B238-AE25D4B91EEA}") For Each p In patchlist WScript.Echo p Next "@ $VBSFile = "$env:TEMP\temp.vbs" $vbsCode | out-file -FilePath $VBSFile $PatchList = cscript.exe $VBSFile | Where-Object {$_ -match "^{" } $VBSFile | Remove-Item -Force -ErrorAction SilentlyContinue $PatchList 

Is it possible to achieve the same result using only PowerShell?

PS {786970C5-E6F6-4A41-B238-AE25D4B91EEA} is the SCMP Agent RTMProductCodeGuid.

  • Try looking at this module: psmsi.codeplex.com . As far as I understand, the standard com-object "WindowsInstaller.Installer" imported into PS does not have the necessary methods ... - n01d

1 answer 1

 PS D:\> $msi = New-Object -ComObject 'WindowsInstaller.Installer' $msi.Patches("{90150000-002A-0409-1000-0000000FF1CE}") # office 2013 std {16F64A9D-6561-4378-98F2-BD2095B78511} {2A7695E2-F9CD-4392-8458-33F834477076} 

Win7x64, PS5.0