Namespace: System.Management.Automation
Assembly: System.Management.Automation (in System.Management.Automation)
Dim instance As Cmdlet Dim sendToPipeline As Object instance.WriteObject(sendToPipeline)
Public Sub WriteObject ( _ sendToPipeline As Object _ )
public void WriteObject ( Object sendToPipeline )
public: void WriteObject ( Object^ sendToPipeline )
public void WriteObject ( Object sendToPipeline )
public function WriteObject ( sendToPipeline : Object )
Parameters
- sendToPipeline
-
The object to be written to the output pipeline.
| Exception type | Condition |
|---|---|
| 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 implementation of an input processing method (BeginProcessing, ProcessRecord, and EndProcessing) and only from that thread. If the call is made from outside these implementations or from another thread, an InvalidOperationException exception is thrown.
This method sends a single object to the pipeline, regardless of whether the object is or is not a collection. To send a collection that is then enumerated by Windows PowerShell, 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.
Target Platforms
Windows Developer Preview, Windows Server Developer PreviewReference
PSCmdlet ClassPSCmdlet Members
System.Management.Automation Namespace
PSCmdlet.WriteDebug Method
PSCmdlet.WriteError Method
Cmdlet.WriteProgress Method
Cmdlet.WriteWarning Method
Cmdlet.WriteVerbose Method
Cmdlet.WriteObject Method
Other Resources
Windows PowerShell CmdletsWindows PowerShell SDK
Send comments about this topic to Microsoft.