DZ1
Hot Shot
Hot Shot

I know I'm missing something really simple

I am trying to get a match with 2 separate names in it...here is what I have:

Get-Template | ? {  ( $_.Name -match 'afd') -and ($_.Name -match 'afvm')  }

I basically want to get templates that start with afd and also afvm.  If I only use the first part Get-Template | ? { $_.Name -match 'afd' } then I can get the names that only start with what I am looking for, but I can't get them both.  I'm sure I'm missing something easy.  I have tried using parenthesis, leaving them out, and some other variations.  Please help if you can.

0 Kudos
1 Reply
DZ1
Hot Shot
Hot Shot

Nevermind, I should use -or and not -and

0 Kudos