Page 2 of 2

Re: returning of an object from jobtracker completedscript block

Posted: Wed Nov 25, 2015 11:13 am
by jvierra
Good luck. Glad you got it.

Re: returning of an object from jobtracker completedscript block

Posted: Wed Nov 25, 2015 11:14 am
by dan.potter
sure it does.

Code: Select all

$buttonStartJob_Click={

$JobScript={
[PSCustomObject]@{mycomputer = $env:computername}
}

$UpdateScript={
Param($Job)

}

$CompletedScript={
Param($Job)
$script:results = Receive-Job -Job $Job

}

$jobSplat=@{
Name='myjob'
JobScript=$JobScript
UpdateScript=$UpdateScript
CompletedScript=$COmpletedScript
}

Add-JobTracker @jobSplat

}