CmdID

CmdID / PowerShell / Cmdlets / Test

Test-PSSessionConfigurationFile

Verifies the keys and values in a session configuration file. PowerShell reference

From the PowerShell reference 1 parameter

Opens CmdID with your command, read as PowerShell. It is read in your browser and sent nowhere.

What it does

from the PowerShell reference, CC BY 4.0

Verifies the keys and values in a session configuration file. This cmdlet verifies that a session configuration file contains valid keys and the values are of the correct type. For enumerated values, the cmdlet verifies that the specified values are valid. The cmdlet returns $true if the file passes all tests and $false if it does not. To find any errors, use the Verbose parameter. Test-PSSessionConfigurationFile verifies the session configuration files, such as those created by the New-PSSessionConfigurationFile cmdlet. For information about session configurations, see about_Session_Configurations. For information about session configuration files, see about_Session_Configuration_Files. This cmdlet was introduced in PowerShell 3.0.

Test-PSSessionConfigurationFile [-Path] <String> [<CommonParameters>]

Test a session configuration file

Test-PSSessionConfigurationFile -Path "FullLanguage.pssc"Identify

Test the session configuration file of a session configuration

Test-PSSessionConfigurationFile -Path (Get-PSSessionConfiguration -Name Restricted).ConfigFilePathIdentify

Test all session configuration files

function Test-AllConfigFiles { Get-PSSessionConfiguration | ForEach-Object { if ($_.ConfigFilePath) { $_.ConfigFilePath Test-PSSessionConfigurationFile -Verbose -Path $_.ConfigFilePath } } } Test-AllConfigFilesIdentify

Its page in the reference: Test-PSSessionConfigurationFile.

Parameters

1 in the PowerShell reference
-PathSpecifies the path and filename of a session configuration file (.pssc). If you omit the path, the default is the current folder. Wildcard characters are supported, but they must resolve to a single file. You can also pipe a session configuration file path to Test-PSSessionConfigurationFile.