Advertisement
Guest User

Untitled

a guest
Sep 5th, 2015
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. $ping = new-object System.Net.NetworkInformation.Ping
  2. $reply = $ping.send('127.0.0.1')
  3. if ($reply.status -eq "Success"){
  4. [string]::Format("Reply from {0},time={1}",$reply.Address.ToString(),$reply.RoundtripTime)
  5. }else{
  6. $z = [system.net.dns]::gethostaddresses($hostname)[0].ipaddresstostring
  7. [string]::Format("FAIL,{0},{1}",$z,"***")
  8. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement