Get-NetAdapter -Name MyEthernetPort | ? status -EQ disabled | Enable-NetAdapter -Confirm:$false
Get-NetAdapter -Name MyEthernetPort | ? status -NE disabled | Disable-NetAdapter -Confirm:$false Here is my existing script: $lanState = Get-NetAdapter -Name MyEthernetPort | where status -EQ 'up' I now want to know how to switch off WiFi without disabling the underlying network adapter. ps1 script which switches a network connection between Ethernet and WiFi.