Dela via


PSSession.Create(Runspace, String, PSCmdlet) Method

Definition

Creates a PSSession object from the provided remote runspace object. If psCmdlet argument is non-null, then the new PSSession object is added to the session runspace repository (Get-PSSession).

public static System.Management.Automation.Runspaces.PSSession Create (System.Management.Automation.Runspaces.Runspace runspace, string transportName, System.Management.Automation.PSCmdlet psCmdlet);
static member Create : System.Management.Automation.Runspaces.Runspace * string * System.Management.Automation.PSCmdlet -> System.Management.Automation.Runspaces.PSSession
Public Shared Function Create (runspace As Runspace, transportName As String, psCmdlet As PSCmdlet) As PSSession

Parameters

runspace
Runspace

Runspace for the new PSSession.

transportName
String

Optional transport name.

psCmdlet
PSCmdlet

Optional cmdlet associated with the PSSession creation.

Returns

Applies to