Thread: match question
View Single Post
Old 11-23-2008   #1 (permalink)
Ripp
Guest


 
 

match question

How would i do a statement to make sure an IP does not match an IP in a .txt
file i have?

Exampe:
$noAlertFile = get-content "noalert.txt"
$ip = "172.16.98.100"
if ($ip -notmatch $noAlertFile) {process} else {otherwise "do not alert"}

The noalert.txt file contains a list of IPs, what is a good way to see if
the $IP does not exist in the $noAlertFile object?

Thanks,
Ripp
My System SpecsSystem Spec