Skip to content

Querying for installed products and patches

Heath Stewart edited this page Feb 19, 2018 · 2 revisions

Basic product query

To view all products within the default context (all contexts accessible the user):

get-msiproductinfo

To view all products that are installed in the machine context (products accessible to all users):

get-msiproductinfo -context machine

All products matching a ProductName pattern

You can always pipe output from these cmdlets to where-object:

get-msiproductinfo | where { $_.ProductName -like "*Visual Studio*" -and $_.ProductVersion -gt "10.0" }

However, to match a ProductName to a pattern you can use the -name parameter:

get-msiproductinfo -name "*Visual Studio*" | where { $_.ProductVersion -gt "10.0" }

All patches applied to a product

You can view all patches installed for all products like so:

get-msipatchinfo

But if you would like to see all patches installed for a specific product - even superseded patches:

get-msiproduct "{93489CA8-6656-33A0-A5AC-E0EDEDB17C3E}" | get-msipatchinfo -context All

You can also specify the ProductCode directly to get-msipatchinfo as the first unnamed parameter:

get-msipatchinfo "{93489CA8-6656-33A0-A5AC-E0EDEDB17C3E}" -context All
Clone this wiki locally