I have working Import-Csv statement that uses Where-Object
Import-Csv D:\Script\my.csv | Where-Object {$_.SourceIP -Like '10.251.22.11*' -Or $_.SourceIP -Like '10.251.22.*' -Or $_.DestinationIP -Like '10.251.22.11*' -Or $_.DestinationIP -Like '10.251.22.*'}
If I try to simplify the statement, it doesn't work
Import-Csv D:\Script\my.csv | Where-Object {($_.SourceIP -Like ('10.251.22.11*' -Or '10.251.22.*')) -Or ($_.DestinationIP -like ('10.251.22.11*' -Or '10.251.22.*'))}
Google is not helping :-(
-likeaccepts only a single string with wildcards. Seehelp about_Operatorsfor details. There is no-orfor-like.