Windows Dev Center

Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

PowerShell.Create Method (InitialSessionState)

Initializes a new instance of the PowerShell class with an empty pipeline and an initial session state; a script or command must be added before invoking this instance. Introduced in Windows PowerShell 3.0.


Namespace: System.Management.Automation
Assembly: System.Management.Automation (in System.Management.Automation.dll)

'Usage
Dim initialSessionState As InitialSessionState
Dim returnValue As PowerShell

returnValue = PowerShell.Create(initialSessionState)

public:
static PowerShell^ Create (
	InitialSessionState^ initialSessionState
)
public static PowerShell Create (
	InitialSessionState initialSessionState
)
public static function Create (
	initialSessionState : InitialSessionState
) : PowerShell

Parameters

initialSessionState

The initial session state with which to create the runspace.

Return Value

A PowerShell object with an empty pipeline.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

 

Target Platforms


Show:
© 2015 Microsoft