anchor.diff:  call :wait_for_device "%TAP_NAME%"
   
   :: Attempt to rename the device even if waiting timed out.
  -netsh interface set interface name= "%TAP_NAME%" newname= "%DEVICE_NAME%"
  +netsh interface set interface name="%TAP_NAME%" newname="%DEVICE_NAME%"
   if %errorlevel% neq 0 (
  -  echo Could not rename TAP device. >&2
  -  exit /b %ERROR_TAP_RENAME%
  +  :: Try to rename the device through powershell in case netsh failed due to not being able to "see"
  +  :: the device. Pipe input from /dev/null to prevent powershell from waiting forever on EOF.
  +  powershell "Rename-NetAdapter -Name \"%TAP_NAME%\" -NewName \"%DEVICE_NAME%\"" <nul
  +  :: Note that we use delayed variable expansion inside a control block to check errorlevel.
  +  if !errorlevel! neq 0 (
  +    echo Could not rename TAP device. >&2
  +    exit /b %ERROR_TAP_RENAME%
  +  )
   )
   
   :: Wait for the new name to propagate to netsh.
  
positive.code: :: limitations under the License.
  
  @echo off
  setlocal
  
  set DEVICE_NAME=outline-tap0
  set DEVICE_HWID=tap0901
  
negative.code:   :: "ERROR: Input redirection is not supported, exiting the process immediately."
    waitfor /t 10 thisisnotarealsignalname >nul 2>&1
    netsh interface ip show interfaces | find "%~1" >nul 2>&1
    if !errorlevel! equ 0 exit /b 0
  )
  exit /b 1
  