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)

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

value = instance.Error

instance.Error = value

[SuppressMessageAttribute("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly", Justification="We want to allow callers to change the backing store.")] 
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
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.


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.
Show:
© 2014 Microsoft