OSD icon indicating copy to clipboard operation
OSD copied to clipboard

Test-WebConnection Returns False Even When Connected To Network

Open PyKestrel opened this issue 2 years ago • 1 comments

The Error After wiping the disk, the script begins to test the web connectivity and returns false causing the script to fail. Upon further investigation I was able to trace it back to the Test-WebConnection Uri, that being google.com.

If I invoke a web request like such: Invoke-WebRequest -Method 'Head' -Uri 'google.com' -UseBasicParsing

It would return an error in which it stated that it was forbidden under my policy to reach this site. This is most likely because we are enforcing HTTPS somewhere along the way.

Work Around To work around this, I edited the Test-WebConnection function and changed the Uri to 'https://google.com' and that was successful.

Is it possible to change the function so that it checks for both http and https connections to avoid this potential error in the future?

This was all tested on a Dell OptiPlex 5090, I can send some screenshot of the exact errors should you need them.

PyKestrel avatar Oct 18 '23 18:10 PyKestrel

What about SSL Inspection config on your firewall? Could it be possible to check this behaviour in your home network if it's still the same?

AkosBakos avatar Nov 07 '23 07:11 AkosBakos