Query a Windows Installer (MSI) using Powershell

This is just a quick example of how we can query a Windows Installer using Powershell code:


When writing Powershell functions to return single values (a string, for example) please ensure you pipe any calls to ‘Execute’ or ‘Close’ to ‘Out-Null’ (please see above). ¬†This will stop the function from returning a System.Object[] (since Powershell functions return the whole output from the function, and not just the value after the ‘return’ statement)!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.