I was trying to create a virtual switch in powershell so that i could port forward on one of my vms in Hyper-V
I have also tried using the Hyper-V virtual switch manager to create the external switch but that also returned errors like 'Ethernet port _ bind failed: Element not found. (0x80070490)'.
I have tried uninstalling wireshark and reated apps, and running netcfg -d, but those have not fixed the issue
Powershell:
PS C:\WINDOWS\system32> New-VMSwitch -Name "NAT" -NetAdapterName Wi-Fi -AllowManagementOS:$true
New-VMSwitch : Adding ports to the switch 'NAT' failed.
The operation failed because the object was not found.
At line:1 char:1
+ New-VMSwitch -Name "NAT" -NetAdapterName Wi-Fi -AllowManagementOS:$tr ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (:) [New-VMSwitch], VirtualizationException
+ FullyQualifiedErrorId : ObjectNotFound,Microsoft.HyperV.PowerShell.Commands.NewVMSwitch
After running a second time:
PS C:\WINDOWS\system32> New-VMSwitch -Name "NAT" -NetAdapterName Wi-Fi -AllowManagementOS:$true
New-VMSwitch : Failed while adding virtual Ethernet switch connections.
Ethernet port '{76E086C0-8B1A-4EB7-9CCE-D79F1C6B90CF}' bind failed: Cannot create a file when that file already exists. (0x800700B7).
At line:1 char:2
+ New-VMSwitch -Name "NAT" -NetAdapterName Wi-Fi -AllowManagementOS:$t ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [New-VMSwitch], VirtualizationException
+ FullyQualifiedErrorId : Unspecified,Microsoft.HyperV.PowerShell.Commands.NewVMSwitch