Home > PowerShell > Check if a application is installed or not using powershell

Check if a application is installed or not using powershell

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

No related content found.

Categories: PowerShell
  1. Sampath
    January 31, 2012 at 12:56 am | #1

    Hey Thanks

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

  1. No trackbacks yet.

Leave a Reply

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

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>