Share via


RuntimeException Class

Definition

RuntimeException is the base class for exceptions likely to occur while a PowerShell command is running.

public ref class RuntimeException : SystemException, System::Management::Automation::IContainsErrorRecord
[System.Serializable]
public class RuntimeException : SystemException, System.Management.Automation.IContainsErrorRecord
public class RuntimeException : SystemException, System.Management.Automation.IContainsErrorRecord
[<System.Serializable>]
type RuntimeException = class
    inherit SystemException
    interface IContainsErrorRecord
type RuntimeException = class
    inherit SystemException
    interface IContainsErrorRecord
Public Class RuntimeException
Inherits SystemException
Implements IContainsErrorRecord
Inheritance
RuntimeException
Derived
Attributes
Implements

Remarks

PowerShell scripts can trap RuntimeException using the "trap (exceptionclass) {handler}" script construct.

Instances of this exception class are usually generated by the PowerShell Engine. It is unusual for code outside the PowerShell Engine to create an instance of this class.

Constructors

RuntimeException()

Initializes a new instance of the RuntimeException class.

RuntimeException(SerializationInfo, StreamingContext)
Obsolete.

Initializes a new instance of the RuntimeException class using data serialized via ISerializable

RuntimeException(String, Exception, ErrorRecord)

Initializes a new instance of the RuntimeException class starting with an already populated error record.

RuntimeException(String, Exception)

Initializes a new instance of the RuntimeException class.

RuntimeException(String)

Initializes a new instance of the RuntimeException class.

Properties

ErrorRecord

Additional information about the error.

WasThrownFromThrowStatement

Methods

GetObjectData(SerializationInfo, StreamingContext)

Serializer for ISerializable

Applies to