Search notes:

PowerShell cmdLet Write-Output

write-output sends the specified object(s) down the primary pipeline (aka «output stream» or «success pipeline») to the next command in a pipeline.
If write-output is executed in the last command of a pipeline, the objects are rendered in the console.
Generally, write-output is not necessary. The following two pipelines are equivalent:
do-something | write-output
do-something
Note: While do-something | write-output is equivalent to do-something, the following pipeline is not, although at first sight it seems to be.
do-something | write-host

-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 $_" }
Github repository about-PowerShell, path: /cmdlets/output/write/noEnumerate.ps1
The first pipeline writes
object is foo
object is bar
object is baz
The second pipeleine write
object is foo bar baz
write-output … -noEnumerate might be used in functions to return arrays (such as byte arrays).

Alias

An alias for write-output is echo which is the name of commands used in other shells or cmd.exe to display strings in the console)

See also

The cmdLet verb write
Powershell command noun: output

Index