Skip to content

Instantly share code, notes, and snippets.

@ddhahn
Created February 1, 2013 16:30
Show Gist options
  • Save ddhahn/4692388 to your computer and use it in GitHub Desktop.
Save ddhahn/4692388 to your computer and use it in GitHub Desktop.
Filters a list of IP addresses
del "c:\temp\vpn_machines.txt"
$machines = gc "c:\temp\hosts" |% {$_.split("`t")[0]}
foreach ($machine in $machines) {
if ($machine.startswith('10.54')) {
Out-File -InputObject $machine "c:\temp\vpn_machines.txt" -Encoding "ASCII" -append
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment