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

PowerShell

An instance of PowerShell.

Applies to

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

PowerShell

An instance of PowerShell.

Applies to

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
Public Shared Function Create (initialSessionState As InitialSessionState) As PowerShell

Parameters

initialSessionState
InitialSessionState

InitialSessionState with which to create the runspace

Returns

PowerShell

An instance of PowerShell.

Applies to

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
Public Shared Function Create (runspace As Runspace) As PowerShell

Parameters

runspace
Runspace

Returns

PowerShell

Applies to