wait-for-tiworker.ps1 311 Bytes
Newer Older
Stefan Scherer's avatar
Stefan Scherer committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
$procname="TiWorker"

$finished = 0

while ($finished -lt 3) {

  Start-Sleep 30
  Write-Output "Checking for $procname ($finished)"
  $output = "$(get-process -erroraction silentlycontinue $procname)"
  if ( $output -eq "") {
    $finished = $finished + 1
  } else {
    $finished = 0
  }

}