Is there an easy way (not using loops) to apply -like with more than one pattern to one string?
so
"c:\myfile.txt" -like "*.dat","*.txt"
should return $true
"c:\myfile.dat" -like "*.dat","*.txt"
should return $true
“c:\myfile.doc” -like “.dat”,”.txt”
should return $false
I don’t think so. You could use regular expression:
UPDATE
Make a regex pattern from input that contains a wildcard patterns: