Azure-Samples / TestDeviceRegConnectivity

MIT License
27 stars 12 forks source link

[Bug] In function checkProxy() #3

Closed MarcoBuess closed 2 years ago

MarcoBuess commented 2 years ago

Please provide us with the following information:

This issue is for a: (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

Run the script on a computer that has direct access to the internet without proxy configuration.

$global:ProxyServer="NoProxy"
$winHTTP = netsh winhttp show proxy
$Proxy = $winHTTP | Select-String server

The above snipped from the function will lead to the script identifying a proxy as http://Direct access (no proxy server). will will later on lead to an exception on line: 125

Any log messages given by the failure

The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: Cannot validate argument on parameter 'InputObject'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again.

Expected/desired behavior

Connection test to required URIs succeeds without proxy configuration.

OS and Version?

Windows 10 (10.0.19044)

Mention any other details that might be useful

mzmaili commented 2 years ago

Thanks for your feedback, Marco!

Reference to our remote session, the script works as expected.