Windows automatically identifies connected networks and names them as
Wired Network 2 or
windows.domain.tld in case of domain joined systems. Is there any command to get the string of the connected network that Windows has detected it's on?
After trying @Bob's answer, I've noticed it the output lists a line for every network it's connected to:
> Get-NetConnectionProfle | Select-Object -ExpandProperty Name Wired Connection Wireless Connection 3 VPN Name
By default Windows only uses one of the connected networks for all traffic, such as only wired connection even as wireless is connected as well, and only the VPN if connected. What do I do to get only the name string of the default network?