Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
test-connection got you down? ping just not cutting it for you? How about using the System.Net.NetworkInformation.Ping.send() method
# with reference to
function fastping{
[String]$computername = "",
[int]$delay = 100
$ping = new-object System.Net.NetworkInformation.Ping
# see
try {
if ($ping.send($computername,$delay).status -ne "Success") {
return $false;
else {
return $true;
} catch {
return $false;

This comment has been minimized.

Copy link

@alumbs alumbs commented Sep 4, 2015

Thanks a lot. This helped me when the Test-connection cmdlet could not be found on my system anymore (not sure how that happened). Thanks again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment