Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. param (
  2. [string]$ip = "8.8.8.8"
  3. )
  4.  
  5. do {
  6. $ping = Test-Connection $ip -Count 1 -ErrorAction SilentlyContinue
  7. if ($ping -eq $null) {
  8. $host.UI.RawUI.WindowTitle = "Ping: timeout"
  9. write-host "Ping $ip : timeout"
  10. } else {
  11. $host.UI.RawUI.WindowTitle = "Ping: " + $ping.responsetime.ToString()
  12. write-host "Ping $ip : $($ping.responsetime.ToString())"
  13. }
  14. sleep 1
  15. } until (0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement