Ping with audible output
From Tech-Wiki
More actions
Technical reference for Ping with audible output.
Reference
This command will read aloud the status whilst pinging. Useful to remove one of the sections, to notify you when the host goes down or up
Add-Type -AssemblyName System.speech
$speak = New-Object System.Speech.Synthesis.SpeechSynthesizer
while($true) {
if (Test-Connection 8.8.8.8 -Count 1 -quiet) {
$speak.Speak("Host is up!") }
else {
$speak.Speak("Host is down!") }
}