This isn’t actually a peculiarity, as the fact is very well documented when using workflows: You can’t rely on positional parameters in the “native part” of a PowerShell workflow. Most of the time that’s not a problem. However, some cmdlets are just so… familiar is the word I guess. Anyways.
This won’t work:
workflow whereTest { $a = get-process $b = $a | where {$_.Name -match "Powershell"} $b }
This will:
workflow whereTest { $a = get-process $b = $a | where-object -filterscript {$_.Name -match "Powershell"} $b }
Turns out, the filtering thing you use in your “where” cmdlet actually has a parameter, and it’s called “filterscript”. And you need to use it, or else you’ll get the sad message:
Where-Object : Parameter set cannot be resolved using the specified named parameters.
+ CategoryInfo : InvalidArgument: (:) [Where-Object], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : AmbiguousParameterSet,Microsoft.PowerShell.Commands.WhereObjectCommand
+ PSComputerName : [localhost]
So there. Another case of not having to use InlineScript without actually needing to.