IContainsErrorRecord.ErrorRecord Property

Definition

This is the ErrorRecord which provides additional information about the error.

C++
public:
 property System::Management::Automation::ErrorRecord ^ ErrorRecord { System::Management::Automation::ErrorRecord ^ get(); };

Property Value

Remarks

The ErrorRecord instance returned by ErrorRecord should contain in its Exception property an instance of ParentContainsErrorRecordException rather than a reference to the root exception. This prevents a recursive reference between the exception implementing IContainsErrorRecord and the ErrorRecord. Use the ParentContainsErrorRecordException(Exception) constructor so that the ParentContainsErrorRecordException will have the same Message as the root exception.

Applies to

Producto Versiones
PowerShell SDK 7.2.0, 7.3.0, 7.4.0
Windows PowerShell 5.1.0.0