Skip to content

Instantly share code, notes, and snippets.

@RIKIKU
Created September 6, 2017 03:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RIKIKU/accff83da81f6916d98d4bd1d2792c8b to your computer and use it in GitHub Desktop.
Save RIKIKU/accff83da81f6916d98d4bd1d2792c8b to your computer and use it in GitHub Desktop.
$servers = "8.8.8.8", "8.8.4.4"
foreach($server in $servers)
{
@"
?
google.com {0}
"@ -f $server | out-file "C:\Users\kyles\Desktop\in.txt" -Encoding utf8 -Force
Start-Process nslookup -RedirectStandardInput "$env:USERPROFILE\Desktop\in.txt" -RedirectStandardOutput "$env:USERPROFILE\Desktop\out$server.txt" -Wait
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment