Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- param (
- [string]$ip = "8.8.8.8"
- )
- do {
- $ping = Test-Connection $ip -Count 1 -ErrorAction SilentlyContinue
- if ($ping -eq $null) {
- $host.UI.RawUI.WindowTitle = "Ping: timeout"
- write-host "Ping $ip : timeout"
- } else {
- $host.UI.RawUI.WindowTitle = "Ping: " + $ping.responsetime.ToString()
- write-host "Ping $ip : $($ping.responsetime.ToString())"
- }
- sleep 1
- } until (0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement