Set-SCExternalJob
Updates an existing external job.
Syntax
Set-SCExternalJob
[-Job] <Task>
-ProgressValue <Int32>
[<CommonParameters>]
Set-SCExternalJob
[-Job] <Task>
[-Completed]
[-InfoMessage <String>]
[<CommonParameters>]
Set-SCExternalJob
[-Job] <Task>
[-Failed]
-InfoMessage <String>
[<CommonParameters>]
Description
The Set-SCExternalJob cmdlet updates existing external jobs in Virtual Machine Manager (VMM). You can update the percent complete of the job, or set the status of the job to completed or failed.
For more information about external jobs, see the New-SCExternalJob cmdlet.
Examples
Example 1: Set an external job to 15% complete
PS C:\> $ExternalJob = Get-SCJob -Name "ExternalJob01"
PS C:\> Set-SCExternalJob -Job $ExternalJob -ProgressValue 15
The first command gets the external job object named ExternalJob01 and stores the object in the $ExternalJob variable.
The second command sets the progress value for the job stored in $ExternalJob to 15.
Example 2: Set an external job to completed
PS C:\> $ExternalJob = Get-SCJob -Name "ExternalJob02"
PS C:\> Set-SCExternalJob -Job $ExternalJob -Completed -InfoMessage "Some information about the completed job"
The first command gets the external job object named ExternalJob02 and stores the object in the $ExternalJob variable.
The second command sets the status of the job stored in $ExternalJob to completed, and adds information about the job.
Example 3: Set an external job to failed
PS C:\> $ExternalJob = Get-SCJob -Name "ExternalJob03"
PS C:\> Set-SCExternalJob -Job $ExternalJob -Failed -InfoMessage "An error message for the failed job"
The first command gets the external job object named ExternalJob03 and stores the object in the $ExternalJob variable.
The second command sets the status of the job stored in $ExternalJob to failed, and adds information about the job.
Parameters
-Completed
Sets the status of an external job to completed.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Failed
Sets the status of an external job to failed.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-InfoMessage
Provides an informational message for external jobs.
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Job
Specifies a VMM job object.
Type: | Task |
Position: | 0 |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-ProgressValue
Supplies the percent complete of the progress of an external job.
Type: | Int32 |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Outputs
Task
This cmdlet returns a Task object.