Use this cmdlet to update an existing sync task after making changes to a SyncTask object directly.
PowerShell
Update-SyncTask
- -Task
- [-TaskID]
Description
Use the Update-SyncTask cmdlet to update a SyncTask or ServiceTaskItem.
This parameter can accept either a ServiceTaskItem or a SyncTask object.
The Get-SyncTask cmdlet can retrieve a ServiceTaskItem from the task queue. If changes are made directly to this object, this cmdlet can update the task queue with the changed object. This is in contrast to Set-SyncTask which uses one or more parameters to change setting of a task.
Examples
Example 1
PowerShell
$task = Import-SyncTask 'c:\path\to\file.task' Update-SyncTask -Task $task -TaskID 11223344-aabb-ccdd-eeff-112233445566
This example will update the task in the task queue with the provided TaskID with the values of the $task object.
Example 2
PowerShell
$serviceTask = Get-SyncTask | Select -First 1 $serviceTask.Name = "Johns Calendars" Update-SyncTask -Task $serviceTask
This example updates the task and provides it with a new name. In contrast to Example #1, this example does not require the use of the -TaskID parameter because the $serviceTask object retrieved by Get-SyncTask already contains the TaskID.
Parameters
-Task
The Task parameter specifies the SyncTask or ServiceTaskItem that should be used to update the task in the task queue.
Note that if a ServiceTaskItem is used, and it already has a TaskID value, the -TaskID parameter is not used or required. If a SyncTask object is used, the -TaskID parameter is required to identify the task in the task queue to be updated.
-TaskID
The TaskID parameter is used to identify the specific task in the task queue that is to be updated. This parameter is required if the -Task parameter is a SyncTask object.
