Matching "How To" query.

by Jul 10, 2015

Hi All,

I've been working on a script to give me a nice little status report post doing some installation and configuration work that we can hand over to the client to say "Yay! we did our job properly!"

I've hit a point where I'm running the following command:

Get-WmiObject -class "Win32_NetworkAdapter" -computername $Computername | Where {$_.NetConnectionID -Match "BUR"}

And it does what I want to do, however, I then repeat the code block 3 times to cope with the three variations that I need to gather info on. What I'd really like to do is something like the following:

Get-WmiObject -class "Win32_NetworkAdapter" -computername $Computername | Where {$_.NetConnectionID -Match "BUR" or "PROD" or "MGT"}

Currently all my googling tells me that this isn't possible using "-Match" but I bet there's some guru out there that's done this kind of thing before and can point me in the right direction.

Cheers,

Dave

[H]