Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

PSDataStreams.Error Property

 

Updated: April 27, 2016

Applies To: Windows PowerShell

Gets or sets the error data stream for the PowerShell object. The command invoked by the PowerShell object writes information to this stream whenever a nonterminating error occurs. This property is introduced in Windows PowerShell 2.0.

Namespace:   System.Management.Automation
Assembly:  System.Management.Automation (in System.Management.Automation.dll)

public PSDataCollection<ErrorRecord> Error { get; set; }

Property Value

Type: System.Management.Automation.PSDataCollection<ErrorRecord>

A PSDataCollection<T> object that contains ErrorRecord objects for each nonterminating error.

Exception Condition
ArgumentNullException

The property is set to null.

InvalidPowerShellStateException

The PowerShell object cannot be changed in its current state.

ObjectDisposedException

The PowerShell object has been disposed.

Cmdlets that are run by the PowerShell object write error information using the Cmdlet.WriteError method.

Provider cmdlets that are run by the PowerShell object write error information using the CmdletProvider.WriteError method.

Return to top

Community Additions

Show: