Merge pull request #198 from Romanitho/review-testnetwork

Changed connectivity check
pull/199/head
Romain 2022-10-21 15:39:47 +02:00 committed by GitHub
commit cc6316d48f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 3 deletions

View File

@ -8,10 +8,11 @@ function Test-Network {
#Test connectivity during 30 min then timeout
Write-Log "Checking internet connection..." "Yellow"
While ($timeout -lt 1800) {
$URLtoTest = "https://raw.githubusercontent.com/Romanitho/Winget-AutoUpdate/main/LICENSE"
$URLcontent = ((Invoke-WebRequest -URI $URLtoTest).content)
$TestNetwork = Test-NetConnection 8.8.8.8 -Port 443 -InformationLevel Quiet
if ($TestNetwork) {
if ($URLcontent -like "*MIT License*") {
Write-Log "Connected !" "Green"