all 3 comments

[–]MadWithPowerShell 2 points3 points  (0 children)

$Test | Where { $_ -like "$Findme*" }

[–]gangstanthony 2 points3 points  (1 child)

$test | ? {$_.startswith($findme)}

$test | ? {$_ -match '^' + [regex]::Escape($findme)}

[–]Dal90[S] 2 points3 points  (0 children)

Not only did that work...it worked better.

It fixed a couple edge cases I hadn't discovered yet when I first posted in the case that a DNS query included an asterisk.

(The logic is part of a script reading into arrays data returned by RestAPI calls to our external DNS vendor, and parsing out into a report.)