CommandMetadata.GetRestrictedCommands Method (SessionCapabilities)

 

Updated: April 27, 2016

Applies To: Windows PowerShell

Retrieves information about how Windows PowerShell commands are restricted based on the capabilities of the session, such as sessions used for implicit and interactive remoting.

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

public static Dictionary<string, CommandMetadata> GetRestrictedCommands(
	SessionCapabilities sessionCapabilities
)

Parameters

sessionCapabilities
Type: System.Management.Automation.SessionCapabilities

A SessionCapabilities constant that specifies the capabilities of the session, such as the session being used for implicit and interactive remoting.

Return Value

Type: System.Collections.Generic.Dictionary<String, CommandMetadata>

Returns a Dictionary<TKey, TValue> object that contains information about how Windows PowerShell-provided commands are restricted based on the capabilities of the session.

For example, implicit remoting does not use all the parameters of the Get-Help cmdlet, and uses only a limited set of argument values for the Get-Help parameters that it does use.

The CreateRestricted method is used to define the initial session-state for sessions whose commands are restricted based on session capabilities; however it does not guarantee that those commands are available. The InitialSessionState object returned by this method guarantees only that when the command is run its restricted functionality is all that is available.

Return to top

Community Additions

ADD
Show: