Hi @rameez hasan ,
We can only get status by following scripts. We are unable to get the number of actions
Add-PSSnapin microsoft.sharepoint.powershell -ErrorAction SilentlyContinue
$web = get-spweb -Identity https://spwebUrl
$list = $web.Lists["ListName"]
$wfm = New-object Microsoft.SharePoint.WorkflowServices.WorkflowServicesManager($web)
$sub = $wfm.GetWorkflowSubscriptionService()
$wfs = $sub.EnumerateSubscriptionsByList($list.ID)
$wfis=$wfm.GetWorkflowInstanceService()
foreach ($item in $list.Items)
{
$workflowInstances=$wfis.EnumerateInstancesForListItem($list.ID,$item.ID)
foreach($wf in $workflowInstances)
{
$wfName = $wfs | ?{$_.Id -eq $wf.WorkflowSubscriptionId} | select -ExpandProperty Name
$wfID= $wf.ID
$wfStatus = $wf.Status
$wfListItem = $item.Name
write-host "Workflow Title: $wfName Status: $wfStatus ListItem: $wfListItem"
}
}
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.