Friday, October 7, 2022
HomePowershellMonitor Community Connectivity with PowerShell 7 (Profitable Pings) – SID-500.COM

Monitor Community Connectivity with PowerShell 7 (Profitable Pings) – SID-500.COM


PowerShell

Just lately, I’ve created a script that returns a beep sound when the connection is re-established. I wish to share this script right here on my web site.

Assume your community connectivity is damaged. You wait till the connection is restored. As well as, you need to hear a sound when the connection is re-established. For this process, simply use my script.

Observe that the ping is carried out 10000 occasions. That is realized by $_ and 1…10000.

This script was examined in PowerShell 7.

1..10000 | ForEach-Object {
If ((Check-Connection -ComputerName 8.8.8.8 -Depend $_).Standing.Value__ -eq '0') {
    [System.Console]::Beep(200,1000)
}
}

Have enjoyable!

Printed by Patrick Gruenauer

Microsoft MVP on PowerShell [2018-2023], IT-Coach, IT-Guide, MCSE: Cloud Platform and Infrastructure, Cisco Licensed Academy Teacher.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments