Set-SCExternalJob
Updates an existing external job.
Syntax
Progress (Default)
Set-SCExternalJob
[-Job] <Task>
-ProgressValue <Int32>
[<CommonParameters>]
Completed
Set-SCExternalJob
[-Job] <Task>
[-Completed]
[-InfoMessage <String>]
[<CommonParameters>]
Failed
Set-SCExternalJob
[-Job] <Task>
-InfoMessage <String>
[-Failed]
[<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.
Parameter properties
Type: | SwitchParameter |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
Completed
Position: | Named |
Mandatory: | True |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-Failed
Sets the status of an external job to failed.
Parameter properties
Type: | SwitchParameter |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
Failed
Position: | Named |
Mandatory: | True |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-InfoMessage
Provides an informational message for external jobs.
Parameter properties
Type: | String |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
Completed
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-Job
Specifies a VMM job object.
Parameter properties
Type: | Task |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | 0 |
Mandatory: | True |
Value from pipeline: | True |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-ProgressValue
Supplies the percent complete of the progress of an external job.
Parameter properties
Type: | Int32 |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
Progress
Position: | Named |
Mandatory: | True |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
Outputs
Task
This cmdlet returns a Task object.