InitialSessionState.Create Method
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Create(String) |
Want to get away from SnapIn and console file. Have modules and assemblies instead. Specify the registered SnapIn name or name collection. |
Create(String[], PSConsoleLoadException) | |
Create() |
Creates an empty InitialSessionState object... |
Want to get away from SnapIn and console file. Have modules and assemblies instead. Specify the registered SnapIn name or name collection.
C++
public:
static System::Management::Automation::Runspaces::InitialSessionState ^ Create(System::String ^ snapInName);
public static System.Management.Automation.Runspaces.InitialSessionState Create (string snapInName);
static member Create : string -> System.Management.Automation.Runspaces.InitialSessionState
Public Shared Function Create (snapInName As String) As InitialSessionState
Parameters
- snapInName
- String
Returns
Applies to
PowerShell SDK 7.4.0 and other versions
Product | Versions |
---|---|
PowerShell SDK | 7.2.0, 7.3.0, 7.4.0 |
Windows PowerShell | 5.1.0.0 |
C++
public:
static System::Management::Automation::Runspaces::InitialSessionState ^ Create(cli::array <System::String ^> ^ snapInNameCollection, [Runtime::InteropServices::Out] System::Management::Automation::Runspaces::PSConsoleLoadException ^ % warning);
public static System.Management.Automation.Runspaces.InitialSessionState Create (string[] snapInNameCollection, out System.Management.Automation.Runspaces.PSConsoleLoadException warning);
static member Create : string[] * PSConsoleLoadException -> System.Management.Automation.Runspaces.InitialSessionState
Public Shared Function Create (snapInNameCollection As String(), ByRef warning As PSConsoleLoadException) As InitialSessionState
Parameters
- snapInNameCollection
- String[]
- warning
- PSConsoleLoadException
Returns
Applies to
PowerShell SDK 7.4.0 and other versions
Product | Versions |
---|---|
PowerShell SDK | 7.2.0, 7.3.0, 7.4.0 |
Windows PowerShell | 5.1.0.0 |
Creates an empty InitialSessionState object...
C++
public:
static System::Management::Automation::Runspaces::InitialSessionState ^ Create();
public static System.Management.Automation.Runspaces.InitialSessionState Create ();
static member Create : unit -> System.Management.Automation.Runspaces.InitialSessionState
Public Shared Function Create () As InitialSessionState
Returns
Applies to
PowerShell SDK 7.4.0 and other versions
Product | Versions |
---|---|
PowerShell SDK | 7.2.0, 7.3.0, 7.4.0 |
Windows PowerShell | 5.1.0.0 |