Windows Dev Center

PSDataStreams.Error Property

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)

Dim instance As PSDataStreams
Dim value As PSDataCollection(Of ErrorRecord)

value = instance.Error

instance.Error = value

public PSDataCollection<ErrorRecord> Error { get; set; }
/** @property */
public PSDataCollection<ErrorRecord> get_Error ()

/** @property */
public void set_Error (PSDataCollection<ErrorRecord> value)

public function get Error () : PSDataCollection<ErrorRecord>

public function set Error (value : PSDataCollection<ErrorRecord>)

Property Value

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

Exception typeCondition

The property is set to null.


The PowerShell object cannot be changed in its current state.


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.

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

© 2015 Microsoft