powershell - Getting installed programs and filtering them by publisher -


ok, can list of installed programs via get-wmiobject win32_product | select name i'd list of select publishers "microsoft" , "google".

so programs installed:
adobe reader - adobe
itunes - apple
chrome - google
visual studio- microsoft

run program output:
chrome
visual studio

thank help.

when in doubt, read documentation. publisher name stored in vendor property, can filter results this:

$vendors = 'microsoft corporation', 'google' $names = get-wmiobject win32_product |          ? { $vendors -contains $_.vendor } |          select -expand name 

fuzzy matches on list of vendors little more complicated. should work, though:

$vendors = 'microsoft', 'google' $names = get-wmiobject win32_product |          ? { $vendors | ? { $_.vendor -like "*$_*" } } |          select -expand name 

Comments

Popular posts from this blog

PHP DOM loadHTML() method unusual warning -

python - How to create jsonb index using GIN on SQLAlchemy? -

c# - TransactionScope not rolling back although no complete() is called -