Add-SpectreJob
Description
This function adds a Spectre job to the list of jobs you want to wait for with Wait-SpectreJobs.
To retrieve the outcome of the job you need to use the standard PowerShell Receive-Job cmdlet.
Examples
Example 1
This example demonstrates how to add two jobs to a context and wait for them to complete.
Parameters
Context
The Spectre context to add the job to. The context object is only available inside Invoke-SpectreCommandWithProgress. https://spectreconsole.net/api/spectre.console/progresscontext/
Type | Required | Position | PipelineInput |
---|---|---|---|
[ProgressContext] | true | 1 | false |
JobName
The name of the job to add.
Type | Required | Position | PipelineInput |
---|---|---|---|
[String] | true | 2 | false |
Job
The PowerShell job to add to the context.
Type | Required | Position | PipelineInput |
---|---|---|---|
[Job] | true | 3 | false |