Skip to content

Instantly share code, notes, and snippets.

@Cabeda
Created November 5, 2018 12:00
Show Gist options
  • Save Cabeda/5dc372ab50b43115d693c3b331829b8d to your computer and use it in GitHub Desktop.
Save Cabeda/5dc372ab50b43115d693c3b331829b8d to your computer and use it in GitHub Desktop.
Powershell script to continously check for an HTTP connection
param (
[string]$server = "www.google.com"
)
"Checking connection for " + $server
$hasConnection = $false
while ($hasConnection -eq $false) {
$result = Test-NetConnection $server
if($result.PingSucceeded) {
$hasConnection = $true
}
}
"Got a connection!!!"
Read-Host -Prompt "Press Enter to Leave"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment