≡ Menu

Check if a application is installed or not using powershell

Use the script at http://techibee.com/powershell/powershell-script-to-query-softwares-installed-on-remote-computer/1389 to get installed software. Using Win32_Product has it’s own set of problems. 

I have seen my colleague writting multi line script to do subjected task in powershell today. Scripts works great but felt why can’t we do it with single line code. After messing up with options, I ended at below command.

Get-WmiObject -Class Win32_Product -Computer <remote-comp-name> | Sort-object Name | select Name

Looks cool and simple right? This command lists all the application installed in a given machine.

Now lets extend the functioanality to check if a particular application exists or not…and this can be done with single command again!!.

Get-WmiObject -Class Win32_Product | sort-object Name | select Name | where { $_.Name -match “Office”}

Happy Learning..,
Sitaram Pamarthi

{ 6 comments… add one }
  • Sampath January 31, 2012, 12:56 am

    Hey Thanks

    These single liners made my day and that credit goes to you.

  • Dave March 13, 2013, 11:50 pm

    This is good, but it will run an integrity check and can have adverse effects on a production machine.

    Check out this:

    get-itemproperty hklm:\software\microsoft\windows\currentversion\uninstall\* | select *
    get-itemproperty hklm:\software\wow6432node\microsoft\windows\currentversion\uninstall\* | select *

    • John Knight May 13, 2016, 4:37 pm

      Thanks Dave, I have used your suggestion to check for a specifically named program:

      Get-WmiObject -Class Win32_Product -Computer tc-app01-s-vi | sort-object Name | select Name | where { $_.Name -match “Office”}

  • AK October 1, 2015, 1:26 am

    This is bad. Don’t use this!

    • TechiBee October 3, 2015, 4:39 pm

      yes, Win32_Product is crappy. Please use the link specified in post to get the installed softwares using powershell.

Leave a Comment