Created
August 16, 2018 03:58
-
-
Save LawrenceHwang/d0e2f03b103e53e28a8c619afabbd96b to your computer and use it in GitHub Desktop.
Renew IP until the node receives a lease with PowerShell
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$InterfaceAlias = 'Wi-Fi' | |
while ((Get-NetIPAddress -InterfaceAlias $InterfaceAlias -AddressFamily IPv4).IPAddress -like '169*') | |
{ | |
$arg = '/C ipconfig /renew' | |
Start-Process -FilePath 'cmd.exe' -argumentlist $arg -wait -PassThru | |
Start-Sleep -Seconds 3 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment