Skip to content

Instantly share code, notes, and snippets.

@ghotz
Created October 25, 2014 12:29
Show Gist options
  • Select an option

  • Save ghotz/846fb84bf296505674af to your computer and use it in GitHub Desktop.

Select an option

Save ghotz/846fb84bf296505674af to your computer and use it in GitHub Desktop.
Waits for a port to be opened using netstat
$PortToFind = "6012";
$SleepIntervalMs = 200;
while ($true)
{
$nstat = (netstat -nab);
if ($nstat -like "*$PortToFind*")
{
$nstat -like "*$PortToFind*";
break;
};
Start-Sleep -Milliseconds $SleepIntervalMs
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment