Skip to content

Commit 372b3b6

Browse files
committed
fix(tap-adapter.ps1): work with alternate name Local Area Connection
* the `tapinstall.exe` command creates adapters with the generic names of either `Ethernet x` or `Local Area Connection x`.
1 parent 3efe81f commit 372b3b6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

openvpn/files/tap-adapter.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
 (0)