Last active
January 9, 2026 14:18
-
-
Save s-h-a-d-o-w/934c6ef2e05f3f3ba74f4f6c0b1bf94f to your computer and use it in GitHub Desktop.
Repeatedly checks whether a certain IP is reachable and shows a popup if it's not.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ip = "192.168.1.1" | |
| Add-Type -AssemblyName System.Windows.Forms | |
| while ($true) { | |
| if (!(Test-Connection $ip -Count 1 -Quiet)) { | |
| [System.Windows.Forms.MessageBox]::Show( | |
| "Device $ip is offline!", | |
| "Network Alert", | |
| [System.Windows.Forms.MessageBoxButtons]::OK, | |
| [System.Windows.Forms.MessageBoxIcon]::Warning | |
| ) | Out-Null | |
| } | |
| Start-Sleep -Seconds 5 | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment