Skip to content

Instantly share code, notes, and snippets.

@LarryWeiss
Created June 24, 2019 20:07
Show Gist options
  • Save LarryWeiss/88e1075b7c4b334e2f96da40e0eb3cf9 to your computer and use it in GitHub Desktop.
Save LarryWeiss/88e1075b7c4b334e2f96da40e0eb3cf9 to your computer and use it in GitHub Desktop.
$results = echo (0..2) -pipelinevariable second | % {
echo (0..10) -pipelinevariable third | % {
echo (0..254) -pipelinevariable fourth | % {
$status = Test-NetConnection -CommonTCPPort HTTP "10.$second.$third.$_"
if ($status.TcpTestSucceeded) {
$results = Invoke-WebRequest -SkipCertificateCheck "10.$second.$third.$_"
if (Select-String -pattern "airos" -InputObject $results.Content) {
'10.'+$second+'.'+$third+'.'+$fourth
}
}
}
}
}
Add-Content -Path .\web.txt -Value $results -Force
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment