ICommandRuntime.WriteError(ErrorRecord) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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);
[System.Runtime.CompilerServices.NullableContext(1)]
public void WriteError (System.Management.Automation.ErrorRecord errorRecord);
abstract member WriteError : System.Management.Automation.ErrorRecord -> unit
[<System.Runtime.CompilerServices.NullableContext(1)>]
abstract member WriteError : System.Management.Automation.ErrorRecord -> unit
Public Sub WriteError (errorRecord As ErrorRecord)
Parameters
- errorRecord
- ErrorRecord
Error.
- Attributes
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.