Ok, this is insane have you seen the filter function? I just discovered it! (for myself of course).
I happen to be playing around with functions to filter my content and saw that the filter word I used was not acting like other functions. Then that got me to googling to find this page: https://4sysops.com/archives/the-powershell-filter-2/
I did not know that this was a thing, who would have thought? Awesome!
so following the example here is what I came up with for my situation:
filter myfilter {
foreach ($wf in $workflowfields)
{
if ($_.$wf -ne $null)
{
$_
}
}
}
$listitems | myfilter
Whaaaaaa laaaa stuff is filtered where the workflow status fields are not null!!!!
This gives me the whole item object too!