Skip to content

Rule: Avoid ForEach between cmdlets with compatible pipeline inputs/outputs #10

Description

@clcaldwell

Avoid ForEach-Object between cmdlets with compatible pipeline inputs/outputs.

Bad: gci | % {Get-Content $_.FullName}
Bad: (gci).foreach{Get-Content $_.FullName}
Good: gci | Get-Content

Implementation might be difficult. To start, look for - Pipeline Input > ByPropertyName / ByValue

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions