I have this code:
$resultset = $stuff | Where-Object { $_.Prop1.SubProp7 -eq 'SearchString' }
Very similar code is repeated quite a few times. (in a Pester test).
How can I wrap that code in a simple filter helper?
filter Where-Subprop7($SearchString) {
<#??#> | Where-Object { $_.Prop1.SubProp7 <#??#> -eq $SearchString } | ...???
}
$resultset = $stuff | Where-Subprop7 'SearchString'