Export (0) Print
Expand All
0 out of 1 rated this helpful - Rate this topic

Cmdlet.WriteObject Method (Object, Boolean)

Writes an object to the output pipeline that can be enumerated by Windows PowerShell.


Namespace: System.Management.Automation
Assembly: System.Management.Automation (in System.Management.Automation.dll)
'Usage
Dim instance As Cmdlet
Dim sendToPipeline As Object
Dim enumerateCollection As Boolean

instance.WriteObject(sendToPipeline, enumerateCollection)
public void WriteObject (
	Object sendToPipeline,
	bool enumerateCollection
)
public void WriteObject (
	Object sendToPipeline, 
	boolean enumerateCollection
)
public function WriteObject (
	sendToPipeline : Object, 
	enumerateCollection : boolean
)

Parameters

sendToPipeline

The object to be sent to the pipeline.

enumerateCollection

True indicates that Windows PowerShell runtime will enumerate the object one level. The default is False.

Exception typeCondition
PipelineStoppedException

The pipeline is stopped. The pipeline was terminated either before the call was made or while the call was in progress. By default, the cmdlet should allow the caller of the processing record method to catch this exception.

InvalidOperationException

The call cannot be completed at this time or cannot be completed from this thread. For more information, see the following Remarks section.

This method can be called only from within the cmdlet implementation of the BeginProcessing, ProcessRecord, and EndProcessing methods and only from that thread. If this call is made from outside these implementations or from another thread, an InvalidOperationException exception is thrown.

For more information about how to send an object that is not a collection, see the Cmdlet.WriteObject method.

Cmdlets can also write to the debug, error, progress, warning, and verbose data streams by using the following methods:

For more information about cmdlets, see Windows PowerShell Cmdlets.


Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

 

Target Platforms

Windows Developer Preview, Windows Server Developer Preview

Send comments about this topic to Microsoft.
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.