View Single Post
Old 04-26-2007   #1 (permalink)
Larry R


 
 

Using the $_ pipeline with WMI

Newbie here...
I am trying to develop a list of software that needs to be uninstalled
on a computer.

I have the output list :
IdentifyingNumber name vendor
----------------- ---- ------
{01A4AEDE-F219-49A2-B855-16A016EAF9A4} Intel(R) PROSet II Intel


and am trying to iterate through the list and get-wmiobject for each
IdentifyingNumber , then Unintsall.

Here is what I have:
get-content "c:\productsintel.txt" |Get-WmiObject -Class win32_product
-Filter "IdentifyingNumber='$_.IdentifyingNumber'"


1) How do I reference the IdentifyingNumber correctly when reading the
file?
2) is the "filter" syntax correct?

Thanks
Larry

My System SpecsSystem Spec