How to get a list of installed software products?

前端 未结 4 1643
清歌不尽
清歌不尽 2020-12-19 15:27

How do I get a list of software products which are installed on the system. My goal is to iterate through these, and get the installation path of a few of them.

PSEU

4条回答
  •  时光说笑
    2020-12-19 16:00

    You can ask the WMI Installed applications classes: the Win32_Products class represents all products installed by Windows Installer. For instance the following PS script will retrieve all prodcuts installed on local computer that were installed by Windows Installer:

    Get-WmiObject -Class Win32_Product -ComputerName .
    

    See Working with Software Installations. POrting the PS query to the equivalent C# use of WMI API (in other words Using WMI with the .NET Framework) is left as an exercise to the reader.

提交回复
热议问题