hi,
How I can achieve the below power shell script using "queryWMI" action
Get-WmiObject win32_product | where-object name -like "MongoDB*"
<queryWMI>
<class>win32_product</class>
<fields>Name;Version;Vendor</fields>
<run>0</run>
<variable>result</variable>
<where>name -like "MongoDB*"</where>
</queryWMI>
Hi @GulzarA ,
Thanks for your message. I was able to get the information using a slightly different snippet. Can you try it?
<queryWMI>
<class>win32_product</class>
<fields>Name;Version;Vendor</fields>
<run>1</run>
<variable>result</variable>
<where>name like "MongoDB%"</where>
</queryWMI>
Notice I'm not using the parameters in the same way that the Get-WmiObject command expects them in Powershell, but kind of a SQL format, and also that I'm setting the run parameter with value 1.
The sample works perfectly, Thank you , correction made in this tag <where>name like "MongoDB%"</where>
with regards
Gulzar
Hi @GulzarA ,
Thanks for your message. I'm glad the provided snippet solved your issue!