
I also recently watched a session from the PowerShell summit 2019 on youtube that brings up the issue that using Win32_Product makes the msi installers run consistency checks and potentially run repairs. Getting a list of the installed software has taken a number of different approaches with PowerShell but allows to test that the correct software is installed and also produce a text file with the software installed information as a build artifact for later reference. I’ve been using Pester to verify software that is installed on TeamCity build agents that are being created with Packer and a number of PowerShell scripts. Here’s a post on a few ways you can find installed software on Windows using PowerShell. Avoid Get-CimInstance and Get-WMIObject.Finding installed software with PowerShell on Windows
