Friday, 7 November 2014

Powershell: Get List of Installed Software Programs

We can find the list of installed programs and third party software products through Control Panel's Add or Remove Programs UI. But if you are working in Infrastructure Management team, you need to frequently check the list of installed software, so the Powershell script will be very useful to list installed application. In this article, I am going write Powershell script samples using Get-WmiObject -Class Win32_Product to get installed products in Local and Remote Machine.

Summary:


List Installed Software using Powershell in Local Machine

You can list the installed software programs using Powershell's WMI Class Win32_Product. Here, FT is nothing but the Format-Table cmdlet, you can change it into FL to display result in list view.
Get-WMIObject -Query "SELECT * FROM Win32_Product" | FT
Find and Get List of Installed Software via Powershell

You can also use this command: Get-WMIObject -Class Win32_Product to find installed programs.

List Installed Software using Powershell in Remote Computer

You can list the installed software programs from Remote Machine by giving name of remote computer through argument syntax -ComputerName.
Get-WMIObject -ComputerName "your-pc" -Query "SELECT * FROM Win32_Product" | FL
Find and Get List of Installed Software via Powershell

Get List of Installed Programs using Powershell with Filter

You can use SQL Query like syntax in Win32_Product class. The following Powershell script, filter and list only Non-Microsoft softwares.
Get-WMIObject -Query "SELECT * FROM Win32_Product Where Not Vendor Like '%Microsoft%'" |FT
Get List of Installed Products via Powershell

Use following powershell script, filter and list only Microsoft based softwares.
Get-WMIObject -Query "SELECT * FROM Win32_Product Where Vendor Like '%Microsoft%'" | FT

Export Installed Product List into CSV file using Powershell

You can export the installed software application details to CSV using Powershell's Export-CSV cmdlet. The following script exports the Non-Microsoft based products to CSV file from Remote Computer.
Get-WMIObject -ComputerName "hp-pc"`
       -Query "SELECT * FROM Win32_Product Where Not Vendor Like '%Microsoft%'" |
        Select-Object Name,Version,Vendor,InstallLocation,InstallDate |
        Export-CSV 'C:\Non_MS_Products.csv'
Export Installed Software Program Details to CSV via Powershell


Thanks,
Morgan
Software Developer

Advertisements
Advertisements

No comments:

Post a Comment