In this case it's better to use a CSV file to provide the software you want
uninstalled as you can import that back as an object
PoSH> $sw = (gwmi win32_product -prop IdentifyingNumber,name,vendor)
PoSH> $sw | select [a-z]* |? {$_.Vendor -eq 'Macromedia'}
IdentifyingNumber Name
Vendor
----------------- ----
------
{91057632-CA70-413C-B628-2D3CDBBB906B} Macromedia Flash Player 8 Plugin
Macromedia
PoSH> $sw | select [a-z]* |? {$_.Vendor -eq 'Macromedia'} | Export-Csv
Macromedia.csv
PoSH> Import-Csv Macromedia.csv |% {gwmi win32_product -filter
"Vendor='$($_.vendor)'"}
IdentifyingNumber : {91057632-CA70-413C-B628-2D3CDBBB906B}
Name : Macromedia Flash Player 8 Plugin
Vendor : Macromedia
Version : 8.0.22.0
Caption : Macromedia Flash Player 8 Plugin
Greetings /\/\o\/\/
http://thePowerShellGuy.Com
"Larry R" <wantitoverwith@gmail.com> wrote in message
news:1177610197.702375.236720@t38g2000prd.googlegroups.com...
> 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
>