InitialSessionState.Create Method

 

Updated: April 27, 2016

Applies To: Windows PowerShell

Creates an InitialSessionState object. The variants of this method can create an InitialSessionState object that is empty, that specifies a snap-in or snap-in collection, and that specifies a snap-in collection and warning exception. This method is introduced in Windows PowerShell 2.0.

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

NameDescription
System_CAPS_pubmethodSystem_CAPS_staticCreate()

Creates an empty InitialSessionState object that contains none of the commands provided by Windows PowerShell. When this method is used, each element of the session state must be added explicitly.This method is introduced in Windows PowerShell 2.0.

System_CAPS_pubmethodSystem_CAPS_staticCreate(String)

Creates an InitialSessionState object that includes the name of the snap-in or the name of a snap-in collection. This method is introduced in Windows PowerShell 2.0.

System_CAPS_pubmethodSystem_CAPS_staticCreate(String[], PSConsoleLoadException)

Creates an InitialSessionState object that includes the names of the snap-ins to load. This method is introduced in Windows PowerShell 2.0.

Return to top

Community Additions

ADD
Show: