Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 192300

Re: JOB Object

$
0
0

finally I use this script:

     $allTask=$args[0]

     $sleeptime=$args[1]

     while (($allTask | where {$_.State -eq "running"}).count -gt 0) {

            $i=0

            $temp=@()    

            while ($i -le $allTask.Count){

                 $temp = $temp + (Get-Task | where {$_.Id -match $allTask[$i].Id})    

                 $i++

            }

            $allTask=$temp

            Sleep -s $sleeptime

     }


Viewing all articles
Browse latest Browse all 192300

Trending Articles