Quantcast
Channel: Use -notlike to filter out multiple strings in PowerShell - Stack Overflow
Viewing all articles
Browse latest Browse all 10

Answer by Keith Hill for Use -notlike to filter out multiple strings in PowerShell

$
0
0

I think Peter has the right idea. I would use a regular expression for this along with the -notmatch operator.

Get-EventLog Security | ?{$_.Username -notmatch '^user1$|^.*user$'}

Viewing all articles
Browse latest Browse all 10

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>