InitialSessionState.CreateFromSessionConfigurationFile Method

Definition

Overloads

CreateFromSessionConfigurationFile(String, Func<String,Boolean>, Boolean)

Creates an initial session state from a PSSC configuration file.

CreateFromSessionConfigurationFile(String)

Creates an initial session state from a PSSC configuration file.

CreateFromSessionConfigurationFile(String, Func<String,Boolean>)

Creates an initial session state from a PSSC configuration file.

CreateFromSessionConfigurationFile(String, Func<String,Boolean>, Boolean)

Creates an initial session state from a PSSC configuration file.

C#
public static System.Management.Automation.Runspaces.InitialSessionState CreateFromSessionConfigurationFile (string path, Func<string,bool> roleVerifier, bool validateFile);

Parameters

path
String

The path to the PSSC session configuration file.

roleVerifier
Func<String,Boolean>

The verifier that PowerShell should call to determine if groups in the Role entry apply to the target session. If you have a WindowsPrincipal for a user, for example, create a Function that checks windowsPrincipal.IsInRole().

validateFile
Boolean

Validates the file contents for supported SessionState options.

Returns

InitialSessionState object.

Applies to

PowerShell SDK 7.4.0 and PowerShell SDK 7.3.0
Product Versions
PowerShell SDK 7.3.0, 7.4.0

CreateFromSessionConfigurationFile(String)

Creates an initial session state from a PSSC configuration file.

C#
public static System.Management.Automation.Runspaces.InitialSessionState CreateFromSessionConfigurationFile (string path);

Parameters

path
String

The path to the PSSC session configuration file.

Returns

InitialSessionState object.

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

CreateFromSessionConfigurationFile(String, Func<String,Boolean>)

Creates an initial session state from a PSSC configuration file.

C#
public static System.Management.Automation.Runspaces.InitialSessionState CreateFromSessionConfigurationFile (string path, Func<string,bool> roleVerifier);

Parameters

path
String

The path to the PSSC session configuration file.

roleVerifier
Func<String,Boolean>

The verifier that PowerShell should call to determine if groups in the Role entry apply to the target session. If you have a WindowsPrincipal for a user, for example, create a Function that checks windowsPrincipal.IsInRole().

Returns

InitialSessionState object.

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