-noEnumerate
If write-output is given an
array of multiple objects, by default, it passes the array as
one object to the next command.
However, if the option -noEnumerate
is used on write-output
, each object in the array is passed individually:
$array_of_three_objects = 'foo', 'bar', 'baz'
write-output $array_of_three_objects | foreach-object { "object is $_" }
write-output -noEnumerate $array_of_three_objects | foreach-object { "object is $_" }
The first pipeline writes
object is foo
object is bar
object is baz
The second pipeleine write
object is foo bar baz