In a PowerShell script I need to run some commands if the network connection type is not "DomainAuthenticated".
The aim is not to change the connection type manually, but run a set of commands.
I found about Get-NetConnectionProfile, but I can't find how to parse its output :
Name : MyName
InterfaceAlias : vEthernet (Port1)
InterfaceIndex : 19
NetworkCategory : DomainAuthenticated
IPv4Connectivity : Internet
IPv6Connectivity : NoTraffic
I need to get the type from the line NetworkCategory so I can test its content and run my commands.