ErrorRecord Constructor

ErrorRecord Constructor

 

Updated: April 27, 2016

Applies To: Windows PowerShell

Initializes a new instance of the ErrorRecord class. The variants of this constructor can create an object that contains information such as the exception, error identifier, and error category, and can create an object that contains information read from the provided serialization information.

Namespace:   System.Management.Automation
Assembly:  System.Management.Automation (in System.Management.Automation.dll)

NameDescription
System_CAPS_pubmethodErrorRecord(ErrorRecord, Exception)

Initializes a new instance of the ErrorRecord class that contains a wrapper exception that already has an error record. Introduced in Windows PowerShell 3.0.

System_CAPS_pubmethodErrorRecord(Exception, String, ErrorCategory, Object)

Initializes a new instance of the ErrorRecord class that contains the exception, error identifier, error category, and more.

System_CAPS_protmethodErrorRecord(SerializationInfo, StreamingContext)

Initializes a new instance of the ErrorRecord class that contains information read from the provided serialization information.

For more information about error records, see Windows PowerShell Error Records.

Return to top

Community Additions

ADD
Show:
© 2016 Microsoft