Cmdlet.WriteObject Cmdlet.WriteObject Cmdlet.WriteObject Method

Definition

Overloads

WriteObject(Object) WriteObject(Object) WriteObject(Object)

Writes the object to the output pipe.

WriteObject(Object, Boolean) WriteObject(Object, Boolean) WriteObject(Object, Boolean)

Writes one or more objects to the output pipe. If the object is a collection and the enumerateCollection flag is true, the objects in the collection will be written individually.

WriteObject(Object) WriteObject(Object) WriteObject(Object)

Writes the object to the output pipe.

public void WriteObject (object sendToPipeline);
member this.WriteObject : obj -> unit
Public Sub WriteObject (sendToPipeline As Object)
Parameters
sendToPipeline
Object Object Object

The object that needs to be written. This will be written as a single object, even if it is an enumeration.

Exceptions

The pipeline has already been terminated, or was terminated during the execution of this method. The Cmdlet should generally just allow PipelineStoppedException to percolate up to the caller of ProcessRecord etc.

Not permitted at this time or from this thread. WriteObject may only be called during a call to this Cmdlet's implementation of ProcessRecord, BeginProcessing or EndProcessing, and only from that thread.

WriteObject(Object, Boolean) WriteObject(Object, Boolean) WriteObject(Object, Boolean)

Writes one or more objects to the output pipe. If the object is a collection and the enumerateCollection flag is true, the objects in the collection will be written individually.

public void WriteObject (object sendToPipeline, bool enumerateCollection);
member this.WriteObject : obj * bool -> unit
Public Sub WriteObject (sendToPipeline As Object, enumerateCollection As Boolean)
Parameters
sendToPipeline
Object Object Object

The object that needs to be written to the pipeline.

enumerateCollection
Boolean Boolean Boolean

true if the collection should be enumerated

Exceptions

The pipeline has already been terminated, or was terminated during the execution of this method. The Cmdlet should generally just allow PipelineStoppedException to percolate up to the caller of ProcessRecord etc.

Not permitted at this time or from this thread. WriteObject may only be called during a call to this Cmdlet's implementation of ProcessRecord, BeginProcessing or EndProcessing, and only from that thread.

Applies to