Skip to content

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

Open

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions