Created
November 5, 2018 12:00
-
-
Save Cabeda/5dc372ab50b43115d693c3b331829b8d to your computer and use it in GitHub Desktop.
Powershell script to continously check for an HTTP connection
This file contains 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
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