Updated on November 20, 2026

You can use Windows PowerShell to check your connection roughly once a minute. The example below plays a sound, writes a warning, and asks Windows to show a notification after two consecutive failed checks. It also shows when the connection check works again.
Choose How You Want to Be Alerted
| What You Need | What Works |
|---|---|
| A warning on the PC you’re using | Use the local PowerShell monitor below. It works while your Windows session and the monitor are running. |
| An alert on your phone while home internet is down | Use a separate online monitoring service that notices when a regular check-in from your network stops arriving. |
| A way to find the cause of brief drops | Compare this monitor with your router’s connection log or test a second device during the drop. |
Set Up the Local Windows Alert
- Open Windows PowerShell from the Start menu while signed in. You can run the monitor as a normal user.
- Paste the whole block below and press Enter. It tries a second website if the first check fails.
- Leave the window open. If it reports a failure while your browser works, make sure the two sites accept the check on your network. You can change the addresses in
$sitesto two HTTPS sites that normally respond there. - To test it, disconnect your own PC from its network when it’s safe to do so and wait for two checks. Reconnect and look for the recovery message. Press Ctrl + C to stop the monitor.
Add-Type -AssemblyName System.Windows.Forms
Add-Type -AssemblyName System.Drawing
$sites = @('https://www.microsoft.com/', 'https://www.cloudflare.com/')
$tray = New-Object System.Windows.Forms.NotifyIcon
$tray.Icon = [System.Drawing.SystemIcons]::Information
$tray.Text = 'Internet connection check'
$tray.Visible = $true
$failures = 0
function Test-InternetConnection {
foreach ($site in $sites) {
try {
$null = Invoke-WebRequest -Uri $site -Method Head -UseBasicParsing -TimeoutSec 6 -ErrorAction Stop
return $true
} catch {
# Try the second site before reporting a connection problem.
}
}
return $false
}
try {
Write-Host 'Monitoring the connection. Press Ctrl+C to stop.'
while ($true) {
if (Test-InternetConnection) {
if ($failures -ge 2) {
Write-Host "$(Get-Date -Format T) Connection check passed again."
}
$failures = 0
} else {
$failures += 1
if ($failures -eq 2) {
$message = 'Two connection checks failed. Check your internet connection.'
Write-Warning $message
[System.Media.SystemSounds]::Exclamation.Play()
$tray.ShowBalloonTip(5000, 'Internet connection check', $message,
[System.Windows.Forms.ToolTipIcon]::Warning)
}
}
for ($second = 0; $second -lt 60; $second += 1) {
[System.Windows.Forms.Application]::DoEvents()
Start-Sleep -Seconds 1
}
}
} finally {
$tray.Dispose()
}
The sound uses your Windows sound settings. If a notification is suppressed, the PowerShell window still displays the warning. For the web request options and the notification method, see Microsoft’s PowerShell request documentation and Windows notification documentation.
Find Out Whether Windows or the Network Dropped
- Only this PC stopped working. Check the Wi-Fi signal or cable, then see whether you can still open the router’s settings.
- Several devices stopped working together. Check the router’s internet status and the modem or ISP outage page.
- The router responds but websites won’t open. Check DNS and try a second device. Our Windows DNS troubleshooting guide shows how to test a lookup.
Frequently Asked Questions
How Quickly Will I Hear an Alert?
The monitor waits about a minute between checks and alerts after the second consecutive failure. Timing depends on when the connection drops and how long the checks take.
Will It Alert Again Every Minute During One Outage?
It alerts once per run of failures. A successful check resets it so the next outage can trigger a new alert.
Will It Work While My PC Is Asleep?
The checks run while the PC is awake and the terminal is open. Sleep pauses the local checks.
Does a Failed Check Prove My Internet Provider Is Down?
It means the PC couldn’t get a response from either site. Wi-Fi, DNS, a proxy, or the websites can also affect the result. Check another device or the router to narrow it down.