NAME
Add-DcsTask
SYNOPSIS
Creates a task used to perform actions automatically when triggered by events.
SYNTAX
Add-DcsTask -Name <String> [ -Description <String> ] [ -ActionDelay <TimeSpan> ] [ -RequireAllTriggers] [ -Disabled] [ -MaxRunTime <TimeSpan> ] [ -Connection <String> ] [ -PipelineVariable <String> ]
DESCRIPTION
Creates a task used to perform actions automatically when events are triggered. This cmdlet creates the task and sets properties of the task. Add a trigger to the task with Add-DcsTrigger. Add an action to the task with Add-DcsAction. Properties of the task can be set with Set-DcsTaskProperties.
PARAMETERS
- -Name<String>
- Name to assign to the task.
-
- Required: true
- Position: named
- Default value:
- Accept pipeline input: false
- Accept wildcard characters: false
-
- -Description<String>
- Description of the task.
-
- Required: false
- Position: named
- Default value:
- Accept pipeline input: false
- Accept wildcard characters: false
-
- -ActionDelay<TimeSpan>
- Use this parameter to set the amount of time to wait before performing actions when triggers are signaled. The format of this parameter consists of decimals representing hours, minutes, and seconds. For instance, 01:05:30 would represent a delay of 1 hour, 5 minutes and 30 seconds. The maximum value must be less than 2 hours. The default value is 0.
-
- Required: false
- Position: named
- Default value:
- Accept pipeline input: false
- Accept wildcard characters: false
-
- -RequireAllTriggers<SwitchParameter>
- This parameter indicates whether to run the task when one trigger is met or to wait until all triggers are met. If specified, the task will only run when all triggers are met.
-
- Required: false
- Position: named
- Default value:
- Accept pipeline input: false
- Accept wildcard characters: false
-
- -Disabled<SwitchParameter>
- Specify this parameter to disable the task. The task will not run until it is enabled (see Enable-DcsTask). If not specified, the task will be enabled.
-
- Required: false
- Position: named
- Default value:
- Accept pipeline input: false
- Accept wildcard characters: false
-
- -MaxRunTime<TimeSpan>
- The amount of time allotted to perform all actions for each instance that the task is run. The time is shared by all actions in the task. When the time has been reached, all actions will be terminated. If triggered again, the same time will be allotted to perform the actions again. The format of this parameter consists of decimals representing days, hours, minutes, and seconds, that are separated by colons. For instance, 01:05:30:00 would represent a maximum run time of 1 day, 5 hours and 30 minutes. The maximum value is 7 days. If this parameter is not specified, the default setting of 7 days (7:00:00:00) will be used.
-
- Required: false
- Position: named
- Default value:
- Accept pipeline input: false
- Accept wildcard characters: false
-
- -Connection<String>
- Alias of the connection to the server group. If not specified, the default connection is used.
-
- Required: false
- Position: named
- Default value:
- Accept pipeline input: false
- Accept wildcard characters: false
-
- -PipelineVariable<String>
-
- Required: false
- Position: named
- Default value:
- Accept pipeline input: false
- Accept wildcard characters: false
-
INPUTS
OUTPUTS
TaskData : Object that identifies and describes the task.
NOTES
Also see Add-DcsTrigger, Add-DcsAction, Remove-DcsTask, Get-DcsTask, Set-DcsTaskProperties.
EXAMPLES
Add-DcsTask -Name MyNightlyTask -Description 'Start Virtual Disk Reclamation at 2 am' -ActionDelay 01:05:30 -RequireAllTriggers
Adds a task named "MyNightlyTask" and set the ActionDelay for 1 hour, 5 minutes and 30 seconds. All triggers must be tripped before actions will be performed.
Description | : | Start Virtual Disk Reclamation at 2 am |
Enabled | : | True |
ActionBehavior | : | RunInBatchMode |
MaxRunTime | : | 6048000000000 |
Connective | : | LogicalAnd |
ActionDelay | : | 39300000000 |
State | : | Idle |
CurrentActionId | : | |
LastStartTime | : | 1/1/0001 12:00:00 AM |
LastStopTime | : | 1/1/0001 12:00:00 AM |
Id | : | 00380dca-5084-49b1-9568-202eced2e79a |
Caption | : | MyNightlyTask |
ExtendedCaption | : | MyNightlyTask |
Internal | : | False |