Export (0) Print
Expand All

New-PSSessionConfigurationFile

Updated: May 8, 2014

Applies To: Windows PowerShell 4.0

New-PSSessionConfigurationFile

Creates a file that defines a session configuration.

Aliases

The following abbreviations are aliases for this cmdlet:

  • npssc

Syntax

Parameter Set: Default
New-PSSessionConfigurationFile [-Path] <String> [-AliasDefinitions <Hashtable[]> ] [-AssembliesToLoad <String[]> ] [-Author <String> ] [-CompanyName <String> ] [-Copyright <String> ] [-Description <String> ] [-EnvironmentVariables <Object> ] [-ExecutionPolicy <ExecutionPolicy> ] [-FormatsToProcess <String[]> ] [-FunctionDefinitions <Hashtable[]> ] [-Guid <Guid> ] [-LanguageMode <PSLanguageMode> ] [-ModulesToImport <Object[]> ] [-PowerShellVersion <Version> ] [-SchemaVersion <Version> ] [-ScriptsToProcess <String[]> ] [-SessionType <SessionType> ] [-TypesToProcess <String[]> ] [-VariableDefinitions <Object> ] [-VisibleAliases <String[]> ] [-VisibleCmdlets <String[]> ] [-VisibleFunctions <String[]> ] [-VisibleProviders <String[]> ] [ <CommonParameters>]




Detailed Description

The New-PSSessionConfigurationFile cmdlet creates a file of settings that define a session configuration and the environment of sessions that are created by using the session configuration. To use the file in a session configuration, use the Path parameters of the Register-PSSessionConfiguration or Set-PSSessionConfiguration cmdlets.

The session configuration file that New-PSSessionConfigurationFile creates is a human-readable text file that contains a hash table of the session configuration properties and values. The file has a .pssc file name extension.

All parameters of New-PSSessionConfigurationFile are optional, except for the Path parameter. If you omit a parameter, the corresponding key in the session configuration file is commented-out, except where noted in the parameter description.

A "session configuration" also known as an "endpoint" is a collection of settings on the local computer that define the environment for Windows PowerShell sessions (PSSessions) that connect to (terminate at) the computer. All PSSessions use a session configuration. To specify a particular session configuration, use the ConfigurationName parameter of cmdlets that create a session, such as the New-PSSession cmdlet.

A session configuration file makes it easy to define a session configuration without complex scripts or code assemblies. The settings in the file are used in addition to the optional startup script and any assemblies in the session configuration.

For more information about session configurations and session configuration files, see about_Session_Configurations (http://go.microsoft.com/fwlink/?LinkID=145152) and about_Session_Configuration_Files (http://go.microsoft.com/fwlink/?LinkID=236023).

This cmdlet is introduced in Windows PowerShell 3.0.

Parameters

-AliasDefinitions<Hashtable[]>

Adds the specified aliases to sessions that use the session configuration. Enter a hash table with the following keys:

-- Name: Name of the alias. This key is required.

-- Value: The command that the alias represents. This key is required.

-- Description: A text string that describes the alias. This key is optional.

-- Options: Alias options. This key is optional. The default value is None. Valid values are None, ReadOnly, Constant, Private, or AllScope.

For example: @{Name="hlp";Value="Get-Help";Description="Gets help";Options="ReadOnly"}


Aliases

none

Required?

false

Position?

named

Default Value

None

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-AssembliesToLoad<String[]>

Specifies the assemblies to load into the sessions that use the session configuration.


Aliases

none

Required?

false

Position?

named

Default Value

None

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Author<String>

Identifies the author of the session configuration or the configuration file. The default is the current user. The value of this parameter is visible in the session configuration file, but it is not a property of the session configuration object.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-CompanyName<String>

Identifies the company that created the session configuration or the configuration file. The default value is "Unknown". The value of this parameter is visible in the session configuration file, but it is not a property of the session configuration object.


Aliases

none

Required?

false

Position?

named

Default Value

"Unknown"

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Copyright<String>

Adds a copyright to the session configuration file. The value of this parameter is visible in the session configuration file, but it is not a property of the session configuration object.

If you omit this parameter, New-PSSessionConfigurationFile generates a copyright statement by using the value of the Author parameter.


Aliases

none

Required?

false

Position?

named

Default Value

'(c) 2012 <User> All rights reserved.

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Description<String>

Describes the session configuration or the session configuration file. The value of this parameter is visible in the session configuration file, but it is not a property of the session configuration object.


Aliases

none

Required?

false

Position?

named

Default Value

None

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-EnvironmentVariables<Object>

Adds environment variables to the session. Enter a hash table in which the keys are the environment variable names and the values are the environment variable values.

For example: EnvironmentVariables=@{TestShare="\\Server01\TestShare"}


Aliases

none

Required?

false

Position?

named

Default Value

None

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-ExecutionPolicy<ExecutionPolicy>

Specifies the execution policy of sessions that use the session configuration. If you omit this parameter, the value of the ExecutionPolicy key in the session configuration file is "Restricted". For information about execution policies in Windows PowerShell, see about_Execution_Policies (http://go.microsoft.com/fwlink/?LinkID=135170).


Aliases

none

Required?

false

Position?

named

Default Value

Restricted

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-FormatsToProcess<String[]>

Specifies the formatting files (.ps1xml) that run in sessions that use the session configuration. The value of this parameter must be a full or absolute path to the formatting files.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-FunctionDefinitions<Hashtable[]>

Adds the specified functions to sessions that use the session configuration. Enter a hash table with the following keys:

-- Name: Name of the function. This key is required.

-- ScriptBlock: Function body. Enter a script block. This key is required.

-- Options: Function options. This key is optional. The default value is None. Valid values are None, ReadOnly, Constant, Private, or AllScope.

For example: @{Name="Get-PowerShellProcess";ScriptBlock={Get-Process PowerShell};Options="AllScope"}


Aliases

none

Required?

false

Position?

named

Default Value

None

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Guid<Guid>

Specifies a unique identifier for the session configuration file. If you omit this parameter, New-PSSessionConfigurationFile generates a GUID for the file. To create a new GUID in Windows PowerShell, type "[guid]::NewGuid()".


Aliases

none

Required?

false

Position?

named

Default Value

GUID generated for the session configuration

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-LanguageMode<PSLanguageMode>

Determines which elements of the Windows PowerShell language are permitted in sessions that use this session configuration. You can use this parameter to restrict the commands that particular users can run on the computer.

Valid values are:

-- FullLanguage: All language elements are permitted.

-- ConstrainedLanguage: Commands that contain scripts to be evaluated are not allowed. The ConstrainedLanguage mode restricts user access to Microsoft .NET Framework types, objects, or methods.

-- NoLanguage: Users may run cmdlets and functions, but are not permitted to use any language elements, such as script blocks, variables, or operators.

-- RestrictedLanguage: Users may run cmdlets and functions, but are not permitted to use script blocks or variables except for the following permitted variables: $PSCulture, $PSUICulture, $True, $False, and $Null. Users may use only the basic comparison operators (-eq, -gt, -lt). Assignment statements, property references, and method calls are not permitted.

The default value of the LanguageMode parameter depends on the value of the SessionType parameter.

-- Empty : NoLanguage
-- RestrictedRemoteServer : NoLanguage
-- Default : FullLanguage


Aliases

none

Required?

false

Position?

named

Default Value

FullLanguage or NoLanguage

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-ModulesToImport<Object[]>

Specifies the modules and snap-ins that are automatically imported into sessions that use the session configuration.

By default, only the Microsoft.PowerShell.Core snap-in is imported into remote sessions, but unless the cmdlets are excluded, users can use the Import-Module and Add-PSSnapin cmdlets to add modules and snap-ins to the session.

Each module or snap-in in the value of this parameter can be represented by a string or as a hash table. A module string consists only of the name of the module or snap-in. A module hash table can include ModuleName, ModuleVersion, and GUID keys. Only the ModuleName key is required.

For example, the following value consists of a string and a hash table. Any combination of strings and hash tables, in any order, is valid.

"TroubleshootingPack", @{ModuleName="PSDiagnostics"; ModuleVersion="1.0.0.0";GUID="c61d6278-02a3-4618-ae37-a524d40a7f44"},

The value of the ModulesToImport parameter of the Register-PSSessionConfiguration cmdlet takes precedence over the value of the ModulesToImport key in the session configuration file.


Aliases

none

Required?

false

Position?

named

Default Value

None

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Path<String>

Specifies the path and file name of the session configuration file. The file must have a .pssc file name extension.


Aliases

none

Required?

true

Position?

1

Default Value

None

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-PowerShellVersion<Version>

Specifies the version of the Windows PowerShell engine in sessions that use the session configuration. Valid values are 2.0 and 3.0. If you omit this parameter, the PowerShellVersion key is commented-out and newest version of Windows PowerShell runs in the session.

The value of the PSVersion parameter of the Register-PSSessionConfiguration cmdlet takes precedence over the value of the PowerShellVersion key in the session configuration file.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-SchemaVersion<Version>

Specifies the version of the session configuration file schema. The default value is "1.0.0.0".


Aliases

none

Required?

false

Position?

named

Default Value

1.0.0.0

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-ScriptsToProcess<String[]>

Adds the specified scripts to sessions that use the session configuration. Enter the path and file names of the scripts. The value of this parameter must be a full or absolute path to script file names.


Aliases

none

Required?

false

Position?

named

Default Value

None

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-SessionType<SessionType>

Specifies the type of session that is created by using the session configuration. The default value is Default. Valid values are:

-- Empty: No modules or snap-ins are added to session by default. Use the parameters of this cmdlet to add modules, functions, scripts, and other features to the session. This option is designed for you to create custom sessions by adding selected command. If you do not add commands to an empty session, the session is limited to expressions and might not be usable.

-- Default: Adds the Microsoft.PowerShell.Core snap-in to the session. This snap-in includes the Import-Module and Add-PSSnapin cmdlets that users can use to import other modules and snap-ins unless you explicitly prohibit the use of the cmdlets.

-- RestrictedRemoteServer: Includes only the following proxy functions: Exit-PSSession,Get-Command, Get-FormatData, Get-Help, Measure-Object, Out-Default, and Select-Object. Use the parameters of this cmdlet to add modules, functions, scripts, and other features to the session.


Aliases

none

Required?

false

Position?

named

Default Value

Default

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-TypesToProcess<String[]>

Adds the specified type files (.ps1xml) to sessions that use the session configuration. Enter the type file names. The value of this parameter must be a full or absolute path to type file names.


Aliases

none

Required?

false

Position?

named

Default Value

None

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-VariableDefinitions<Object>

Adds the specified variables to sessions that use the session configuration. Enter a hash table with the following keys:

-- Name: Name of the variable. This key is required.

-- Value: Variable value. This key is required.

-- Options: Variable options. This key is optional. The default value is None. Valid values are None, ReadOnly, Constant, Private, or AllScope.

For example: @{Name="WarningPreference";Value="SilentlyContinue";Options="AllScope"}


Aliases

none

Required?

false

Position?

named

Default Value

None

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-VisibleAliases<String[]>

Limits the aliases in the session to those specified in the value of this parameter, plus any aliases that you define in the AliasDefinition parameter. Wildcards are supported. By default, all aliases that are defined by the Windows PowerShell engine and all aliases that modules export are visible in the session.

For example: VisibleAliases="gcm", "gp"

When any Visible parameter is included in the session configuration file, Windows PowerShell removes the Import-Module cmdlet and its "ipmo" alias from the session.


Aliases

none

Required?

false

Position?

named

Default Value

None

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-VisibleCmdlets<String[]>

Limits the cmdlets in the session to those specified in the value of this parameter. Wildcards are supported.

By default, all cmdlets that modules in the session export are visible in the session. Use the SessionType and ModulesToImport parameters to determine which modules and snap-ins are imported into the session.

When any Visible parameter is included in the session configuration file, Windows PowerShell removes the Import-Module cmdlet and its "ipmo" alias from the session.


Aliases

none

Required?

false

Position?

named

Default Value

None

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-VisibleFunctions<String[]>

Limits the functions in the session to those specified in the value of this parameter, plus any functions that you define in the FunctionDefinition parameter. Wildcards are supported.

By default, all functions that modules in the session export are visible in the session. Use the SessionType and ModulesToImport parameters to determine which modules and snap-ins are imported into the session.

When any Visible parameter is included in the session configuration file, Windows PowerShell removes the Import-Module cmdlet and its "ipmo" alias from the session.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-VisibleProviders<String[]>

Limits the Windows PowerShell providers in the session to those specified in the value of this parameter. Wildcards are supported.

By default, all providers that modules in the session export are visible in the session. Use the SessionType and ModulesToImport parameters to determine which modules and snap-ins are imported into the session.

When any Visible parameter is included in the session configuration file, Windows PowerShell removes the Import-Module cmdlet and its "ipmo" alias from the session.


Aliases

none

Required?

false

Position?

named

Default Value

None

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see  about_CommonParameters (http://go.microsoft.com/fwlink/p/?LinkID=113216).

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

  • None

    This cmdlet does not take input from the pipeline.


Outputs

The output type is the type of the objects that the cmdlet emits.

  • None

    This cmdlet does not generate any output.


Notes

  • The Visible parameters, such as VisibleCmdlets and VisibleProviders, do not import items into the session. Instead, they select from among the items imported into the session. For example, if the value of the VisibleProviders parameter is the Certificate provider, but the ModulesToImport parameter doesn't specify the Microsoft.PowerShell.Security module that contains the Certificate provider, the Certificate provider is not visible in the session.

  • New-PSSessionConfigurationFile creates a session configuration file with a .pssc file name extension in the path that you specify in the Path parameter. When you use the session configuration file to create a session configuration, the Register-PSSessionConfiguration cmdlet copies the configuration file and saves an active copy of the file in the SessionConfig subdirectory of the $pshome directory.

    The ConfigFilePath property of the session configuration contains the fully qualified path to the active session configuration file. You can edit the active configuration file in the $pshome directory at any time, either by using Windows PowerShell ISE or any text editor. The changes that you make affect all new sessions that use the session configuration, but not existing sessions.

    Before using an edited session configuration file, use the Test-PSSessionConfigurationFile cmdlet to verify that the configuration file entries are valid.

Examples

Example 1: Designing a specialized session

The following command creates a session configuration file for IT technical sessions on a cloud-based document management server.

You can use the resulting file to create a customized session configuration on the server. The ACLs on the session configuration determine who can use the session configuration to create a session on the server.

Customized sessions that include the cmdlets, functions and scripts that technical users need make it easier for those users to write scripts that automate common tasks.


PS C:\> New-PSSessionConfigurationFile -ModulesToImport DMSCmdlets, *Microsoft* -ScriptsToProcess \\Server01\Scripts\Get-DMSServers.ps1

Example 2: Restricting Language in a Session

The commands in this example compare a no-language session to a restricted-language session. The example shows the effect of using the LanguageMode parameter of New-PSSessionConfigurationFile to limit the types of commands and statements that users can run in a session that uses a custom session configuration.

To run the commands in this example, start Windows PowerShell with the "Run as administrator" option. This option is required to run the Register-PSSessionConfiguration cmdlet.


 

The first pair of commands uses the New-PSSessionConfigurationFile cmdlet to create two session configuration files. The first command creates a no-language file. The second command creates a restricted-language file. Other than the value of the LanguageMode parameter, the session configuration files are equivalent.


PS C:\>New-PSSessionConfigurationFile -Path .\NoLanguage.pssc -LanguageMode NoLanguage 
                        
PS C:\>New-PSSessionConfigurationFile -Path .\RestrictedLanguage.pssc -LanguageMode RestrictedLanguage

 

The second pair of commands uses the configuration files to create session configurations on the local computer.


PS C:\>Register-PSSessionConfiguration -Path .\NoLanguage.pssc -Name NoLanguage -Force 
                        
PS C:\>Register-PSSessionConfiguration -Path .\RestrictedLanguage.pssc -Name RestrictedLanguage -Force

 

The third pair of commands creates two sessions, each of which uses one of the session configurations that were created in the previous command pair.


PS C:\>$NoLanguage = New-PSSession -ComputerName Srv01 -ConfigurationName NoLanguage 
                        
PS C:\>$RestrictedLanguage = New-PSSession -ComputerName Srv01 -ConfigurationName RestrictedLanguage

 

The seventh command uses the Invoke-Command cmdlet to run an If statement in the no-Language session. The command fails, because the language elements in the command are not permitted in a no-language session.


PS C:\>Invoke-Command -Session $NoLanguage {if ((Get-Date) -lt "1January2014") {"Before"} else {"After"} }
The syntax is not supported by this runspace. This might be because it is in no-language mode.
+ CategoryInfo : ParserError: (if ((Get-Date) ...") {"Before"} :String) [], ParseException
+ FullyQualifiedErrorId : ScriptsNotAllowed
+ PSComputerName : localhost

 

The eighth command uses the Invoke-Command cmdlet to run the same If statement in the restricted-language session. Because these language elements are permitted in the restricted-language session, the command succeeds.


PS C:\>Invoke-Command -Session $RestrictedLanguage {if ((Get-Date) -lt "1January2014") {"Before"} else {"After"} }
Before

Example 3: Changing a Session Configuration File

This example shows how to change the session configuration file that is used in a session configuration. In this scenario, the administrator wants to add the PSScheduledJob module to sessions created with the ITTasks session configuration. Previously, these sessions had only the core modules and an internal "ITTasks" module.


 

The first command uses the New-PSSessionConfigurationFile cmdlet to create a session configuration file that imports the required modules.


PS C:\> New-PSSessionConfigurationFile -Path .\New-ITTasks.pssc -ModulesToImport Microsoft*, ITTasks, PSScheduledJob

 

The second command uses the Set-PSSessionConfiguration cmdlet to replace the current .pssc file with the new one. Changes to the session configuration affects all sessions created after the change completes.


PS C:\> Set-PSSessionConfiguration -Name  ITTasks -Path .\New-ITTasks.pssc

Example 4: Editing a Session Configuration File

This example shows how to change a session configuration by editing the active session configuration copy of the configuration file.


 

The first command uses the Get-PSSessionConfiguration command to get the path to the configuration file for the ITConfig session configuration. The path is stored in the ConfigFilePath property of the session configuration.


PS C:\> (Get-PSSessionConfiguration -Name ITConfig).ConfigFilePath
C:\WINDOWS\System32\WindowsPowerShell\v1.0\SessionConfig\ITConfig_1e9cb265-dae0-4bd3-89a9-8338a47698a1.pssc

 

To edit the session configuration copy of the configuration file, you might need to edit the file permissions.

In this case, the current user, who is a member of the Administrators group on the system, was explicitly granted full control of the file by using the following method: Right-click the file icon, and then click Properties. On the Security tab, click Edit, and then click Add. Add the user, and then, in the Full control column, click Allow.

Now the user can edit the file. A new "slst" alias for the Select-String cmdlet is added to the file.


PS C:\> AliasDefinitions = @(@{Name='slst';Value='Select-String'})

 

The second command uses the Test-PSSessionConfigurationFile cmdlet to test the edited file. The command uses the Verbose parameter, which displays the file errors that the cmdlet detects, if any.

In this case, the cmdlet returns True ($true), which indicates that it did not detect any errors in the file.


PS C:\> Test-PSSessionConfigurationFile -Path (Get-PSSessionConfiguration -Name ITConfig).ConfigFilePath
True

Example 5: Sample Configuration File

This example displays a New-PSSessionConfigurationFile command that uses all of the cmdlet parameters. It is included to show the correct input format for each parameter.

The resulting SampleFile.pssc is displayed in the output.


PS C:\> New-PSSessionConfigurationFile
-Path .\SampleFile.pssc
-Schema "1.0.0.0"
-Author "User01"
-Copyright "(c) Fabrikam Corporation. All rights reserved."
-CompanyName "Fabrikam Corporation"
-Description "This is a sample file."
-ExecutionPolicy AllSigned
-PowerShellVersion "3.0"
-LanguageMode FullLanguage
-SessionType Default
-EnvironmentVariables @{TESTSHARE="\\Test2\Test"}
-ModulesToImport @{ModuleName="PSScheduledJob"; ModuleVersion="1.0.0.0"; GUID="50cdb55f-5ab7-489f-9e94-4ec21ff51e59"}, PSDiagnostics
-AssembliesToLoad "System.Web.Services","FSharp.Compiler.CodeDom.dll"
-TypesToProcess "Types1.ps1xml","Types2.ps1xml"
-FormatsToProcess "CustomFormats.ps1xml"
-ScriptsToProcess "Get-Inputs.ps1"
-AliasDefinitions @{Name="hlp";Value="Get-Help";Description="Gets help.";Options="AllScope"},@{Name="Update";Value="Update-Help";Description="Updates help";Options="ReadOnly"}
-FunctionDefinitions @{Name="Get-Function";ScriptBlock={Get-Command -CommandType Function};Options="ReadOnly"}
-VariableDefinitions @{Name="WarningPreference";Value="SilentlyContinue"}
-VisibleAliases "c*","g*","i*","s*" `-VisibleCmdlets "Get*"
-VisibleFunctions "Get*"
-VisibleProviders "FileSystem","Function","Variable"
 
                      
@{
# Version number of the schema used for this configuration file
SchemaVersion = '1.0.0.0'

# ID used to uniquely identify this session configuration
GUID = 'f7039ffa-7e54-4382-b358-a393c75c30d3'

# Specifies the execution policy for this session configuration
ExecutionPolicy = 'AllSigned'

# Specifies the language mode for this session configuration
LanguageMode = 'FullLanguage'

# Initial state of this session configuration
SessionType = 'Default'

# Environment variables defined in this session configuration
EnvironmentVariables = @{
TESTSHARE='\\Test2\Test'
}

# Author of this session configuration
Author = 'User01'

# Company associated with this session configuration
CompanyName = 'Fabrikam Corporation'

# Copyright statement for this session configuration
Copyright = '(c) Fabrikam Corporation. All rights reserved.'

# Description of the functionality provided by this session configuration
Description = 'This is a sample file.'

# Version of the Windows PowerShell engine used by this session configuration
PowerShellVersion = '3.0'

# Modules that will be imported
ModulesToImport = @{
ModuleVersion='1.0.0.0'
ModuleName='PSScheduledJob'
GUID='50cdb55f-5ab7-489f-9e94-4ec21ff51e59'
}, 'PSDiagnostics'

# Assemblies that will be loaded in this session configuration
AssembliesToLoad = 'System.Web.Services', 'FSharp.Compiler.CodeDom.dll'

# Aliases visible in this session configuration
VisibleAliases = 'c*', 'g*', 'i*', 's*'

# Cmdlets visible in this session configuration
VisibleCmdlets = 'Get*'

# Functions visible in this session configuration
VisibleFunctions = 'Get*'

# Providers visible in this session configuration
VisibleProviders = 'FileSystem', 'Function', 'Variable'

# Aliases defined in this session configuration
AliasDefinitions = @(
@{
Description='Gets help.'
Name='hlp'
Options='AllScope'
Value='Get-Help'
},
@{
Description='Updates help'
Name='Update'
Options='ReadOnly'
Value='Update-Help'
}
)

# Functions defined in this session configuration
FunctionDefinitions = @(
@{
Name='Get-Function'
Options='ReadOnly'
ScriptBlock={Get-Command -CommandType Function}
}
)

# Variables defined in this session configuration
VariableDefinitions = @(
@{
Value='SilentlyContinue'
Name='WarningPreference'

# Type files (.ps1xml) that will be loaded in this session configuration
TypesToProcess = 'C:\WINDOWS\System32\WindowsPowerShell\v1.0\SessionConfig\Types1.ps1xml', 'C:\WINDOWS\System32\WindowsPowerShell\v1.0\SessionConfig\Types2.ps1xml'

# Format files (.ps1xml) that will be loaded in this session configuration
FormatsToProcess = 'C:\WINDOWS\System32\WindowsPowerShell\v1.0\SessionConfig\CustomFormats.ps1xml'

# Specifies the scripts to execute after the session is configured
ScriptsToProcess = 'C:\WINDOWS\System32\WindowsPowerShell\v1.0\SessionConfig\Get-Inputs.ps1'
}

 

Related topics



Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft