File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -12,10 +12,10 @@ if ($PSCmdlet.ParameterSetName -eq 'new') {
1212 Write-Host " changed=no comment=`' TAP-Windows adapter $New exists`' "
1313 exit
1414 }
15- if (-Not (Get-NetAdapter - InterfaceDescription $tapDesc | Where-Object Name -Like Eth * )) {
15+ if (-Not (Get-NetAdapter - InterfaceDescription $tapDesc | Where-Object Name -Match " ^(Ethernet|Local Area Connection) " )) {
1616 $p = Start-Process $tapInstallCmd - ArgumentList $tapInstallArgs - NoNewWindow - Wait - PassThru
1717 }
18- Get-NetAdapter - InterfaceDescription $tapDesc | Where-Object Name -Like Eth * `
18+ Get-NetAdapter - InterfaceDescription $tapDesc | Where-Object Name -Match " ^(Ethernet|Local Area Connection) " `
1919 | Select-Object - First 1 | Rename-NetAdapter - NewName $New
2020 Write-Host " changed=yes comment=`' TAP-Windows adapter $New created`' "
2121}
You can’t perform that action at this time.
0 commit comments