New rule to have checks for inefficient filtering.
Should warn on | Where-Object & .Where{} pattern when the cmdlet to the left of the pipe includes it's own filtering methods. Might have to either hard-code a list of cmdlets to flag this for, or do some sort of inspection and flag on cmdlets that have a -Filter, -Include, or -Exclude ?
Also see if we can flag the same thing for a filtering foreach, like: `foreach-object { if ($_.name -eq "abc") Do-Somethign }
New rule to have checks for inefficient filtering.
Should warn on
| Where-Object&.Where{}pattern when the cmdlet to the left of the pipe includes it's own filtering methods. Might have to either hard-code a list of cmdlets to flag this for, or do some sort of inspection and flag on cmdlets that have a-Filter,-Include, or-Exclude?Also see if we can flag the same thing for a filtering foreach, like: `foreach-object { if ($_.name -eq "abc") Do-Somethign }