Set-SCExternalJob
Set-SCExternalJob
Updates an existing external job.
Syntax
Parameter Set: Progress
Set-SCExternalJob [-Job] <Task> -ProgressValue <Int32> [ <CommonParameters>]
Parameter Set: Completed
Set-SCExternalJob [-Job] <Task> -Completed [-InfoMessage <String> ] [ <CommonParameters>]
Parameter Set: Failed
Set-SCExternalJob [-Job] <Task> -Failed -InfoMessage <String> [ <CommonParameters>]
Detailed Description
The Set-SCExternalJob cmdlets updates extising 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.
Parameters
-Completed
Sets the status of an external job to completed.
Aliases |
none |
Required? |
true |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-Failed
Sets the status of an external job failed.
Aliases |
none |
Required? |
true |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-InfoMessage<String>
Provides an informational message for external jobs.
Aliases |
none |
Required? |
true |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-Job<Task>
Specifies a VMM job object.
Aliases |
none |
Required? |
true |
Position? |
1 |
Default Value |
none |
Accept Pipeline Input? |
True (ByValue) |
Accept Wildcard Characters? |
false |
-ProgressValue<Int32>
Supplies the percent complete of the progress of an external job.
Aliases |
none |
Required? |
true |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
<CommonParameters>
This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
Outputs
The output type is the type of the objects that the cmdlet emits.
- Task
Examples
1: Set an external job to 15% complete.
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.
PS C:\> $externalJob = Get-SCJob -Name "ExternalJob01"
PS C:\> Set-SCExternalJob –Job $externalJob –ProgressValue 15
2: Set an external job to completed.
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.
PS C:\> $externalJob = Get-SCJob -Name "ExternalJob02"
PS C:\> Set-SCExternalJob –Job $externalJob –Completed -InfoMessage “Some information about the completed job”
3: Set an external job to failed.
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.
PS C:\> $externalJob = Get-SCJob -Name "ExternalJob03"
PS C:\> Set-SCExternalJob –Job $externalJob –Failed –InfoMessage “An error message for the failed job”