InitialSessionState Methods

InitialSessionState Methods

 

Updated: April 27, 2016

Applies To: Windows PowerShell

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

NameDescription
System_CAPS_pubmethodClone()

Creates an exact copy of the current InitialSessionState object. This method is introduced in Windows PowerShell 2.0.

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.

System_CAPS_pubmethodSystem_CAPS_staticCreateDefault()

Creates an InitialSessionState object that contains the default commands provided by Windows PowerShell. This method is introduced in Windows PowerShell 2.0.

System_CAPS_pubmethodSystem_CAPS_staticCreateDefault2()

Creates a default Windows PowerShell session with the default cmdlets, providers, etc., that are loaded by the modules listed in the Modules property. Introduced in Windows PowerShell 3.0.

System_CAPS_pubmethodSystem_CAPS_staticCreateFrom(String, PSConsoleLoadException)

Creates an InitialSessionState object from a snap-in at a specified path. This method is introduced in Windows PowerShell 2.0.

System_CAPS_pubmethodSystem_CAPS_staticCreateFrom(String[], PSConsoleLoadException)

Creates an InitialSessionState object from a snap-in at a specified path. This method is introduced in Windows PowerShell 2.0.

System_CAPS_pubmethodSystem_CAPS_staticCreateFromSessionConfigurationFile(String)

Creates an initial session state from a PSSC configuration file

System_CAPS_pubmethodSystem_CAPS_staticCreateFromSessionConfigurationFile(String, Func<String, Boolean>)

Creates an initial session state from a PSSC configuration file.

System_CAPS_pubmethodSystem_CAPS_staticCreateRestricted(SessionCapabilities)

Creates an InitialSessionState object that can be used to create sessions whose Windows PowerShell commands are restricted based on the capabilities of the session. This method is introduced in Windows PowerShell 2.0.

System_CAPS_pubmethodEquals(Object)

(Inherited from Object.)

System_CAPS_protmethodFinalize()

(Inherited from Object.)

System_CAPS_pubmethodGetHashCode()

(Inherited from Object.)

System_CAPS_pubmethodGetType()

(Inherited from Object.)

System_CAPS_pubmethodImportPSModule(IEnumerable<ModuleSpecification>)

Add a list of modules to import when the runspace is created.

This element is introduced in Windows PowerShell 5.0.

System_CAPS_pubmethodImportPSModule(String[])

Adds a list of modules to the initial session state. These modules are imported into the runspace when it is opened. This method is introduced in Windows PowerShell 2.0.

System_CAPS_pubmethodImportPSModulesFromPath(String)

Imports all Windows PowerShell modules from a module path by default. Introduced in Windows PowerShell 3.0.

System_CAPS_pubmethodImportPSSnapIn(String, PSSnapInException)

Adds a snap-in to the initial session state. When the snap-in is added to the collection, the assembly is loaded and all elements (cmdlets, formats, and types) are added to the corresponding elements in the InitialSessionState object. This method is introduced in Windows PowerShell 2.0.

System_CAPS_protmethodMemberwiseClone()

(Inherited from Object.)

System_CAPS_pubmethodToString()

(Inherited from Object.)

Return to top

Community Additions

ADD
Show:
© 2016 Microsoft