Update-MSTasks

Update MS Tasks. This function update one or many whole objects at a time, or update lists of specific properties.

Syntax


Update-MSTasks -Updates (Array) [-CreateIfNotFound] [-MatchOnTaskSubject] [-MatchOnLegacyId] [-DontParseDropdownsByName] [-BatchSize (Int32)]

Examples


## Update One
$oneTask = Get-MSTasks -TaskIds 1000
$oneTask.CustomProperty1 = "Green"
$oneTask.CustomInt1 = 99
Update-MSTasks -Updates $oneTask

## Update Many
$manytasks = Get-MSTasks -All -Take 2
foreach($task in $manytasks)
{        
    $task.CustomProperty1 = "Blue"
    $task.CustomInt1 = 99
}
Update-MSTasks -Updates $manytasks

## Update via Hash
$updates = @()
$updates += @{ Id = 1002; CustomProperty1 = "Red"; CustomInt1 = 99 }
$updates += @{ Id = 1004; CustomProperty1 = "Green"; CustomInt1 = 66 }
Update-MSTasks -Updates $updates