PSInvalidCastException Constructors

Definition

Overloads

PSInvalidCastException()

Initializes a new instance of PSInvalidCastException with the message set to typeof(PSInvalidCastException).FullName.

PSInvalidCastException(String)

Initializes a new instance of PSInvalidCastException setting the message.

PSInvalidCastException(SerializationInfo, StreamingContext)
Obsolete.

Initializes a new instance of PSInvalidCastException with serialization parameters.

PSInvalidCastException(String, Exception)

Initializes a new instance of PSInvalidCastException setting the message and innerException.

PSInvalidCastException()

Initializes a new instance of PSInvalidCastException with the message set to typeof(PSInvalidCastException).FullName.

public:
 PSInvalidCastException();
public:
 PSInvalidCastException();
 PSInvalidCastException();
public PSInvalidCastException ();
Public Sub New ()

Applies to

PSInvalidCastException(String)

Initializes a new instance of PSInvalidCastException setting the message.

public:
 PSInvalidCastException(System::String ^ message);
public:
 PSInvalidCastException(Platform::String ^ message);
 PSInvalidCastException(std::wstring const & message);
public PSInvalidCastException (string message);
new System.Management.Automation.PSInvalidCastException : string -> System.Management.Automation.PSInvalidCastException
Public Sub New (message As String)

Parameters

message
String

The exception's message.

Applies to

PSInvalidCastException(SerializationInfo, StreamingContext)

Caution

Legacy serialization support is deprecated since .NET 8

Initializes a new instance of PSInvalidCastException with serialization parameters.

protected:
 PSInvalidCastException(System::Runtime::Serialization::SerializationInfo ^ info, System::Runtime::Serialization::StreamingContext context);
protected PSInvalidCastException (System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);
[System.Obsolete("Legacy serialization support is deprecated since .NET 8", DiagnosticId="SYSLIB0051")]
protected PSInvalidCastException (System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);
new System.Management.Automation.PSInvalidCastException : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> System.Management.Automation.PSInvalidCastException
[<System.Obsolete("Legacy serialization support is deprecated since .NET 8", DiagnosticId="SYSLIB0051")>]
new System.Management.Automation.PSInvalidCastException : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> System.Management.Automation.PSInvalidCastException
Protected Sub New (info As SerializationInfo, context As StreamingContext)

Parameters

info
SerializationInfo

Serialization information.

context
StreamingContext

Streaming context.

Attributes

Applies to

PSInvalidCastException(String, Exception)

Initializes a new instance of PSInvalidCastException setting the message and innerException.

public:
 PSInvalidCastException(System::String ^ message, Exception ^ innerException);
public PSInvalidCastException (string message, Exception innerException);
new System.Management.Automation.PSInvalidCastException : string * Exception -> System.Management.Automation.PSInvalidCastException
Public Sub New (message As String, innerException As Exception)

Parameters

message
String

The exception's message.

innerException
Exception

The exception's inner exception.

Applies to