共用方式為


WSManConnectionInfo Constructors

Definition

Overloads

WSManConnectionInfo()

Creates a WSManConnectionInfo for the following URI and with the default credentials, default server life time and default open timeout http://localhost/ The default shellname Microsoft.PowerShell will be used.

WSManConnectionInfo(PSSessionType)

Constructor that constructs the configuration name from its type

WSManConnectionInfo(Uri)

Constructor to create a WSManConnectionInfo with a uri specified and the default credentials, default server life time and default open timeout.

WSManConnectionInfo(Uri, String, PSCredential)

Constructor to create a WSManConnectionInfo with a uri and explicit credentials - server life time is default and open timeout is default.

WSManConnectionInfo(Uri, String, String)

Constructor used to create a WSManConnectionInfo. This constructor supports a certificate thumbprint to be used while connecting to a remote machine instead of credential.

WSManConnectionInfo(Boolean, String, Int32, String, String, PSCredential)

Constructor used to create a WSManConnectionInfo.

WSManConnectionInfo(String, String, Int32, String, String, PSCredential)

Constructor used to create a WSManConnectionInfo.

WSManConnectionInfo(Boolean, String, Int32, String, String, PSCredential, Int32)
WSManConnectionInfo(String, String, Int32, String, String, PSCredential, Int32)

Constructor used to create a WSManConnectionInfo.

WSManConnectionInfo()

Creates a WSManConnectionInfo for the following URI and with the default credentials, default server life time and default open timeout http://localhost/ The default shellname Microsoft.PowerShell will be used.

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

Applies to

WSManConnectionInfo(PSSessionType)

Constructor that constructs the configuration name from its type

public:
 WSManConnectionInfo(System::Management::Automation::Runspaces::PSSessionType configurationType);
public WSManConnectionInfo (System.Management.Automation.Runspaces.PSSessionType configurationType);
new System.Management.Automation.Runspaces.WSManConnectionInfo : System.Management.Automation.Runspaces.PSSessionType -> System.Management.Automation.Runspaces.WSManConnectionInfo
Public Sub New (configurationType As PSSessionType)

Parameters

configurationType
PSSessionType

type of configuration to construct

Applies to

WSManConnectionInfo(Uri)

Constructor to create a WSManConnectionInfo with a uri specified and the default credentials, default server life time and default open timeout.

public:
 WSManConnectionInfo(Uri ^ uri);
public WSManConnectionInfo (Uri uri);
new System.Management.Automation.Runspaces.WSManConnectionInfo : Uri -> System.Management.Automation.Runspaces.WSManConnectionInfo
Public Sub New (uri As Uri)

Parameters

uri
Uri

Uri of remote runspace.

Exceptions

When an uri representing an invalid path is specified

Applies to

WSManConnectionInfo(Uri, String, PSCredential)

Constructor to create a WSManConnectionInfo with a uri and explicit credentials - server life time is default and open timeout is default.

public:
 WSManConnectionInfo(Uri ^ uri, System::String ^ shellUri, System::Management::Automation::PSCredential ^ credential);
public WSManConnectionInfo (Uri uri, string shellUri, System.Management.Automation.PSCredential credential);
new System.Management.Automation.Runspaces.WSManConnectionInfo : Uri * string * System.Management.Automation.PSCredential -> System.Management.Automation.Runspaces.WSManConnectionInfo
Public Sub New (uri As Uri, shellUri As String, credential As PSCredential)

Parameters

uri
Uri

Uri of remote runspace.

shellUri
String
credential
PSCredential

credentials to use to connect to the remote runspace

Exceptions

When an uri representing an invalid path is specified

Applies to

WSManConnectionInfo(Uri, String, String)

Constructor used to create a WSManConnectionInfo. This constructor supports a certificate thumbprint to be used while connecting to a remote machine instead of credential.

public:
 WSManConnectionInfo(Uri ^ uri, System::String ^ shellUri, System::String ^ certificateThumbprint);
public WSManConnectionInfo (Uri uri, string shellUri, string certificateThumbprint);
new System.Management.Automation.Runspaces.WSManConnectionInfo : Uri * string * string -> System.Management.Automation.Runspaces.WSManConnectionInfo
Public Sub New (uri As Uri, shellUri As String, certificateThumbprint As String)

Parameters

uri
Uri

Uri of remote runspace.

shellUri
String
certificateThumbprint
String

A thumb print of the certificate to use while connecting to the remote machine.

Applies to

WSManConnectionInfo(Boolean, String, Int32, String, String, PSCredential)

Constructor used to create a WSManConnectionInfo.

public:
 WSManConnectionInfo(bool useSsl, System::String ^ computerName, int port, System::String ^ appName, System::String ^ shellUri, System::Management::Automation::PSCredential ^ credential);
public WSManConnectionInfo (bool useSsl, string computerName, int port, string appName, string shellUri, System.Management.Automation.PSCredential credential);
new System.Management.Automation.Runspaces.WSManConnectionInfo : bool * string * int * string * string * System.Management.Automation.PSCredential -> System.Management.Automation.Runspaces.WSManConnectionInfo
Public Sub New (useSsl As Boolean, computerName As String, port As Integer, appName As String, shellUri As String, credential As PSCredential)

Parameters

useSsl
Boolean
computerName
String
port
Int32
appName
String
shellUri
String
credential
PSCredential

Applies to

WSManConnectionInfo(String, String, Int32, String, String, PSCredential)

Constructor used to create a WSManConnectionInfo.

public:
 WSManConnectionInfo(System::String ^ scheme, System::String ^ computerName, int port, System::String ^ appName, System::String ^ shellUri, System::Management::Automation::PSCredential ^ credential);
public WSManConnectionInfo (string scheme, string computerName, int port, string appName, string shellUri, System.Management.Automation.PSCredential credential);
new System.Management.Automation.Runspaces.WSManConnectionInfo : string * string * int * string * string * System.Management.Automation.PSCredential -> System.Management.Automation.Runspaces.WSManConnectionInfo
Public Sub New (scheme As String, computerName As String, port As Integer, appName As String, shellUri As String, credential As PSCredential)

Parameters

scheme
String

Scheme to be used for connection.

computerName
String

Computer to connect to.

port
Int32

Port to connect to.

appName
String

Application end point to connect to.

shellUri
String

remote shell to launch on connection

credential
PSCredential

credential to be used for connection

Exceptions

Invalid scheme or invalid port is specified

Remarks

max server life timeout and open timeout are default in this case

Applies to

WSManConnectionInfo(Boolean, String, Int32, String, String, PSCredential, Int32)

public:
 WSManConnectionInfo(bool useSsl, System::String ^ computerName, int port, System::String ^ appName, System::String ^ shellUri, System::Management::Automation::PSCredential ^ credential, int openTimeout);
public WSManConnectionInfo (bool useSsl, string computerName, int port, string appName, string shellUri, System.Management.Automation.PSCredential credential, int openTimeout);
new System.Management.Automation.Runspaces.WSManConnectionInfo : bool * string * int * string * string * System.Management.Automation.PSCredential * int -> System.Management.Automation.Runspaces.WSManConnectionInfo
Public Sub New (useSsl As Boolean, computerName As String, port As Integer, appName As String, shellUri As String, credential As PSCredential, openTimeout As Integer)

Parameters

useSsl
Boolean
computerName
String
port
Int32
appName
String
shellUri
String
credential
PSCredential
openTimeout
Int32

Applies to

WSManConnectionInfo(String, String, Int32, String, String, PSCredential, Int32)

Constructor used to create a WSManConnectionInfo.

public:
 WSManConnectionInfo(System::String ^ scheme, System::String ^ computerName, int port, System::String ^ appName, System::String ^ shellUri, System::Management::Automation::PSCredential ^ credential, int openTimeout);
public WSManConnectionInfo (string scheme, string computerName, int port, string appName, string shellUri, System.Management.Automation.PSCredential credential, int openTimeout);
new System.Management.Automation.Runspaces.WSManConnectionInfo : string * string * int * string * string * System.Management.Automation.PSCredential * int -> System.Management.Automation.Runspaces.WSManConnectionInfo
Public Sub New (scheme As String, computerName As String, port As Integer, appName As String, shellUri As String, credential As PSCredential, openTimeout As Integer)

Parameters

scheme
String

Scheme to be used for connection.

computerName
String

Computer to connect to.

port
Int32

Port to connect to.

appName
String

Application end point to connect to.

shellUri
String

remote shell to launch on connection

credential
PSCredential

credential to be used for connection

openTimeout
Int32

Timeout in milliseconds for open call on Runspace to finish

Exceptions

Invalid scheme or invalid port is specified

Applies to