ErrorRecord Class
Describes a terminating or nonterminating error that occurred during the processing of a command.


Namespace: System.Management.Automation
Assembly: System.Management.Automation (in system.management.automation.dll)
Usage

Dim instance As ErrorRecord
Syntax

Visual Basic
<SerializableAttribute> _
Public Class ErrorRecord
    Implements ISerializable
C#
[SerializableAttribute] 
public class ErrorRecord : ISerializable
C++
[SerializableAttribute] 
public ref class ErrorRecord : ISerializable
J#
/** @attribute SerializableAttribute() */ 
public class ErrorRecord implements ISerializable
JScript
SerializableAttribute 
public class ErrorRecord implements ISerializable
Remarks

The ErrorRecord class is used only by the Windows PowerShell runtime. There are no established scenarios for deriving from this class. For more information about error records, see Windows PowerShell Error Records.

Error records that describe terminating errors are reported when the Cmdlet.ThrowTerminatingError method and the CmdletProvider.ThrowTerminatingError method are called.

Error records that describe nonterminating errors are reported by calling the Cmdlet.WriteError method and the CmdletProvider.WriteError method.

Error records are also used by several exceptions that are thrown by the Windows PowerShell runtime.


Inheritance Hierarchy

System.Object
  System.Management.Automation.ErrorRecord
     System.Management.Automation.Runspaces.RemotingErrorRecord
Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Platforms

Development Platforms

Windows Server 2008, Windows Vista, Windows Server 2003, Windows XP, Windows 7, Windows 2008 R2

Target Platforms

Windows Server 2008, Windows Server 2003, Windows Vista, Windows XP, Windows 7, Windows 2008 R2
See Also

Page view tracker