PowerShell.Create Method

Definition

Overloads

Create()

Constructs an empty PowerShell instance; a script or command must be added before invoking this instance

Create(RunspaceMode)

Constructs an empty PowerShell instance; a script or command must be added before invoking this instance

Create(InitialSessionState)

Constructs an empty PowerShell instance; a script or command must be added before invoking this instance

Create(Runspace)

Create()

Constructs an empty PowerShell instance; a script or command must be added before invoking this instance

public:
 static System::Management::Automation::PowerShell ^ Create();
public static System.Management.Automation.PowerShell Create ();
static member Create : unit -> System.Management.Automation.PowerShell
Public Shared Function Create () As PowerShell

Returns

An instance of PowerShell.

Create(RunspaceMode)

Constructs an empty PowerShell instance; a script or command must be added before invoking this instance

public:
 static System::Management::Automation::PowerShell ^ Create(System::Management::Automation::RunspaceMode runspace);
public static System.Management.Automation.PowerShell Create (System.Management.Automation.RunspaceMode runspace);
static member Create : System.Management.Automation.RunspaceMode -> System.Management.Automation.PowerShell
Public Shared Function Create (runspace As RunspaceMode) As PowerShell

Parameters

runspace
RunspaceMode

runspace mode

Returns

An instance of PowerShell.

Create(InitialSessionState)

Constructs an empty PowerShell instance; a script or command must be added before invoking this instance

public:
 static System::Management::Automation::PowerShell ^ Create(System::Management::Automation::Runspaces::InitialSessionState ^ initialSessionState);
public static System.Management.Automation.PowerShell Create (System.Management.Automation.Runspaces.InitialSessionState initialSessionState);
static member Create : System.Management.Automation.Runspaces.InitialSessionState -> System.Management.Automation.PowerShell

Parameters

initialSessionState
InitialSessionState

InitialSessionState with which to create the runspace

Returns

An instance of PowerShell.

Create(Runspace)

public static System.Management.Automation.PowerShell Create (System.Management.Automation.Runspaces.Runspace runspace);
static member Create : System.Management.Automation.Runspaces.Runspace -> System.Management.Automation.PowerShell

Parameters

runspace
Runspace

Returns

Applies to