Wait-ConsoleRun
Waits for worker updates while pumping run progress to the PowerShell host.
Syntax
Wait-ConsoleRun
[-Run] <LiveRun>
[<CommonParameters>]#All Parameter SetsDescription
Use after starting background workers that call the handle's Started and Finished methods. Waits until all items have finished and receives queued host output on the pipeline thread, including timed CI progress while workers are slow. It does not schedule work or print the final summary. Call Complete-ConsoleRun in finally after joining the workers. Ctrl+C signals the handle's Cancellation token so workers can drain and report their last outcomes.
Examples
Example 1
try { Wait-ConsoleRun $run; $results = Receive-Job $workerJob -Wait } finally { Complete-ConsoleRun $run }Wait for an existing background runner and retain its results
Parameters
- -Run LiveRun
- The handle shared with background workers.
Common Parameters
This command supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.
For more information, see about_CommonParameters.