Use the script at https://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
Comments on this entry are closed.
Hey Thanks
These single liners made my day and that credit goes to you.
Good to know that it saved some time.
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 *
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”}
This is bad. Don’t use this!
yes, Win32_Product is crappy. Please use the link specified in post to get the installed softwares using powershell.