ICommandRuntime.WriteError(ErrorRecord) ICommandRuntime.WriteError(ErrorRecord) ICommandRuntime.WriteError(ErrorRecord) Method

Definition

Internal variant: Writes the specified error to the error pipe.

public:
 void WriteError(System::Management::Automation::ErrorRecord ^ errorRecord);
public void WriteError (System.Management.Automation.ErrorRecord errorRecord);
abstract member WriteError : System.Management.Automation.ErrorRecord -> unit

Parameters

errorRecord
ErrorRecord ErrorRecord ErrorRecord

error

Remarks

Do not call WriteError(e.ErrorRecord). The ErrorRecord contained in the ErrorRecord property of an exception which implements IContainsErrorRecord should not be passed directly to WriteError, since it contains a ParentContainsErrorRecordException rather than the real exception.

Applies to