How to set the status of workflow task in SharePoint 2010,2013,2016, online using Powershell?

Hello SharePointers,

Below is the Powershell script to update the status of the workflow task column in SharePoint.

$site = Get-SPSite(“http://myssharepointsite”)
$web = $site.RootWeb
$list = $web.Lists[“CloudEnablement”]
$item = $list.GetItemById(20)
$task = $item.Tasks[0]
$ht = new-object Hashtable
$ht[“TaskStatus”] = “Approved”
[Microsoft.SharePoint.Workflow.SPWorkflowTask]::AlterTask($task, $ht, $false)

Happy SharePointing Folks 🙂

Leave a Reply

Your email address will not be published.