From 8d3a6fd4cd46b30c47636bfeebffbc43edc4248c Mon Sep 17 00:00:00 2001 From: Romain <96626929+Romanitho@users.noreply.github.com> Date: Fri, 21 Oct 2022 13:31:35 +0200 Subject: [PATCH] Changed connectivity check --- Winget-AutoUpdate/functions/Test-Network.ps1 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Winget-AutoUpdate/functions/Test-Network.ps1 b/Winget-AutoUpdate/functions/Test-Network.ps1 index fb92b29..d0a963b 100644 --- a/Winget-AutoUpdate/functions/Test-Network.ps1 +++ b/Winget-AutoUpdate/functions/Test-Network.ps1 @@ -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"