How to Ping a Computer using PowerShell
Pinging a computer is really simple, and of course since this is PowerShell we don’t want to use something as primitive as ping.exe, we want to use .NET and take advantage of all the method calls and filters.
1 2 | $ping = New-Object System.Net.NetworkInformation.Ping $ping.Send("www.brangle.com") |
We can also set a timeout so that our computer doesn’t hang to long on a server that won’t respond. Let’s add a timeout of a 5 seconds, we will first need to convert this to milliseconds, so that’s 5,000ms. Of course 5 seconds may not be a resonable timeout, you need to figure out what’s appropriate for you and what you’re willing to tolerate.
1 2 | $ping = New-Object System.Net.NetworkInformation.Ping $ping.Send("www.brangle.com", 5000) |
Technical details: System.Net.NetworkInformation.Ping requires that you have .NET 2.0 or greater.
Ping is a computer network tool used to test whether a particular host is reachable across an IP network.It is also used to self test the network interface card of the computer or as a latency test.I commonly do this when checking my internet connection status.
It is the best time to make some plans for the future and it is time to be happy.
I have read this post and if I could I desire to suggest you few interesting things or advice.
Perhaps you can write next articles referring to this article.
I want to read more things about it!