Skip to content

Commit

Permalink
fix(tap-adapter.ps1): work with alternate name Local Area Connection
Browse files Browse the repository at this point in the history
* the `tapinstall.exe` command creates adapters with the generic names
of either `Ethernet x` or `Local Area Connection x`.
  • Loading branch information
dafyddj committed Jun 9, 2020
1 parent 3efe81f commit 372b3b6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions openvpn/files/tap-adapter.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ if ($PSCmdlet.ParameterSetName -eq 'new') {
Write-Host "changed=no comment=`'TAP-Windows adapter $New exists`'"
exit
}
if (-Not (Get-NetAdapter -InterfaceDescription $tapDesc | Where-Object Name -Like Eth*)) {
if (-Not (Get-NetAdapter -InterfaceDescription $tapDesc | Where-Object Name -Match "^(Ethernet|Local Area Connection)")) {
$p = Start-Process $tapInstallCmd -ArgumentList $tapInstallArgs -NoNewWindow -Wait -PassThru
}
Get-NetAdapter -InterfaceDescription $tapDesc | Where-Object Name -Like Eth* `
Get-NetAdapter -InterfaceDescription $tapDesc | Where-Object Name -Match "^(Ethernet|Local Area Connection)" `
| Select-Object -First 1 | Rename-NetAdapter -NewName $New
Write-Host "changed=yes comment=`'TAP-Windows adapter $New created`'"
}
Expand Down

0 comments on commit 372b3b6

Please sign in to comment.