Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $ping = new-object System.Net.NetworkInformation.Ping
- $reply = $ping.send('127.0.0.1')
- if ($reply.status -eq "Success"){
- [string]::Format("Reply from {0},time={1}",$reply.Address.ToString(),$reply.RoundtripTime)
- }else{
- $z = [system.net.dns]::gethostaddresses($hostname)[0].ipaddresstostring
- [string]::Format("FAIL,{0},{1}",$z,"***")
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement