Jobs are executions of a particular script. You can start a new job with
Invoke-UAScript or through a schedule. Jobs run in PowerShell.exe or Pwsh.exe, depending on the version of PowerShell that was selected. Jobs will report output, pipeline output, progress and will even wait for input.
To start a job with the PowerShell module, use
$Script = Get-UAScript -Id 2Invoke-UAScript -Script $Script
To get the output from a job, use
Get-UAJobOutput. Job output is any string output that may common from one of the various output streams in PowerShell. This may include error, warning, verbose or debug output.
$Job = Get-UAJob -Id 1Get-UAJobOuput -Job $Job
Pipeline output is stored as CliXml. You can use the returned objects as any other object in PowerShell.
$Job = Get-UAJob -Id 1Get-UAJobPipelineOuput -Job $Job
Feedback can come from commands that request it, such as a cmdlet that requires additional parameters to be set, or from invoking a cmdlet like
Read-Host. When feedback is requested by a job, the job will enter a
WaitingForFeedback state. You can find jobs that are waiting for feedback by using
Get-UAJob. You can set the feedback for a job using
The currently executing script. This will be a Script object.
Get-UAScript | Get-Member
The currently executing job. This will be a Job object.
Get-UAJob | Get-Member
The schedule that started this script. If this script was not started from a schedule, this variable will not be present. If the variable is present, it will be a Schedule object.
Get-UASchedule | Get-Member
The ID of the parent job that invoked the current job. This variable will be $null if this job was invoked by a user request or schedule.