← Docs home

Write Single Records to the Pipeline

📐 Guideline.

When a cmdlet returns objects, write them immediately as they are generated. Do not hold them to buffer them into a combined array. The cmdlets that receive the objects can then process, display, or process and display the output without delay. A cmdlet that generates output objects one at a time should call WriteObject. A cmdlet that generates output objects in batches, because an underlying API returns an array of output objects, should call the WriteObject method with its second parameter set to true.