$ping = new-object System.Net.Networkinformation.Ping
While($true)
{
$result = $ping.send("8.8.8.8")
sleep 10
$result1 = $ping.send("8.8.4.4")
sleep 10
if(($result.status -ne "Success") -and ($result1.status -ne "Success"))
{
$date = date
$message = "Internet unavailable: " + $date
echo $message
}
sleep 60
}