docker-pull-1709-async.ps1 440 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
function DockerPull {
  Param ([string]$image)

  Write-Host Installing $image ...
  $j = Start-Job -ScriptBlock { docker pull $args[0] } -ArgumentList $image
  while ( $j.JobStateInfo.state -ne "Completed" -And $j.JobStateInfo.state -ne "Failed" ) {
    Write-Host $j.JobStateInfo.state
    Start-Sleep 10
  }

  $results = Receive-Job -Job $j
  $results
}

DockerPull microsoft/windowsservercore:1709
DockerPull microsoft/nanoserver:1709