wangzhenjjcn/AdobeGenp

Multiple Ethernet Adapters Causes Pop-Up Button to Fail

Closed this issue · 2 comments

The application runs this command

PowerShell Set-ExecutionPolicy Bypass -scope Process -Force;(Get-NetRoute | Where-Object DestinationPrefix -eq '0.0.0.0/0' | Get-NetIPInterface | Where-Object ConnectionState -eq 'Connected') -ne $null

Which will return True if connected to the Internet. But if there are multiple NICs, it will return a object of the NICs...

The first command is when I had both NICs enabled. The second is after I disabled one of the NICs.

image

Right now if you have more than one NIC then clicking the Pop-up button will result in this error:

Powershell was unable to connect to the Internet to fetch current IP addresses. Check you are not blocking it with a firewall.

Disable others,it should be fine

I know you can disable the NIC, that's why the second command has "True" because I disabled the others. 😊

If you're willing, I think a better command to test internet connectivity would be like

(Test-Connection -ComputerName a.dove.isdumb.one -Count 1 -Quiet)

1.) Even if you have a NIC, the current command only tests if the adapter is "Connected" with a default route (0.0.0.0/0), not necessarily if the Internet connection works. Examples: (1) the ISP may not be working, (2) the default gateway may be wrong.
2.) The current command does not work with multiple adapters.
3.) If someone has multiple adapters and does not understand why the program continues to give the error message, they may be unable to use that feature of the program.
4.) Using this new command will also make sure the computer can connect to a.dove.isdumb.one.

Thanks for working on this program!