I am trying to fetch List details along with associated task columns to export into Excel using PowerShell. I am able to get all columns using following script except Assigned To column to show with which user the task is pending with from associated task list.
foreach ($item in $list.Items | Where-Object { $_["Approval"] -eq "15"})
{
foreach($workflow in $item.workflows)`
{
if($item.ID -eq $workflow.ItemId)
{
$wfName = $wf.Name
$wfItem = $workflow.ItemName
$wfPendingWith = $workflow.AssignedTo
write-host "Title: $wfName ListItem: $wfItem PendingWith:$wfPendingWith"
}
}
}
Can you please point out what am I missing here? Thanks.