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
Avoid ForEach-Object between cmdlets with compatible pipeline inputs/outputs.
Bad:
gci | % {Get-Content $_.FullName}Bad:
(gci).foreach{Get-Content $_.FullName}Good:
gci | Get-ContentImplementation might be difficult. To start, look for - Pipeline Input > ByPropertyName / ByValue