Bill Joe
Bill Joe

Reputation: 61

Check connection without "Test-Connection"

I want program a script that check if the computer has Internet or not, and I'm thought in ipconfig, but I don't want specify if I'm connected with wifi, Ethernet, etc.

Can I use another command?

Upvotes: 0

Views: 889

Answers (1)

Loïc MICHEL
Loïc MICHEL

Reputation: 26120

if you have powershell v3 at least you can une invoke-webrequest :

iwr "google.com" |select statuscode, statusdescription   

Upvotes: 2

Related Questions