OSDeploy / OSD

OSD Shared Functions
MIT License
132 stars 54 forks source link

Test-WebConnection Returns False Even When Connected To Network #81

Open PyKestrel opened 9 months ago

PyKestrel commented 9 months ago

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.

AkosBakos commented 8 months ago

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?