Partager via


PSArgumentException Constructors

Definition

Overloads

PSArgumentException()

Initializes a new instance of the PSArgumentException class.

PSArgumentException(String)

Initializes a new instance of the PSArgumentException class.

PSArgumentException(SerializationInfo, StreamingContext)
Obsolete.

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

PSArgumentException(String, Exception)

Initializes a new instance of the PSArgumentException class.

PSArgumentException(String, String)

Initializes a new instance of the PSArgumentException class.

PSArgumentException()

Initializes a new instance of the PSArgumentException class.

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

Applies to

PSArgumentException(String)

Initializes a new instance of the PSArgumentException class.

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

Parameters

message
String

Remarks

Per MSDN, the parameter is message. I confirm this experimentally as well.

Applies to

PSArgumentException(SerializationInfo, StreamingContext)

Caution

Legacy serialization support is deprecated since .NET 8

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

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

Parameters

info
SerializationInfo

Serialization information.

context
StreamingContext

Streaming context.

Attributes

Applies to

PSArgumentException(String, Exception)

Initializes a new instance of the PSArgumentException class.

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

Parameters

message
String
innerException
Exception

Applies to

PSArgumentException(String, String)

Initializes a new instance of the PSArgumentException class.

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

Parameters

message
String
paramName
String

Remarks

Note the unusual order of the construction parameters. ArgumentException has this ctor form and we imitate it here.

Applies to