Compartilhar via


ScriptBlock.CheckRestrictedLanguage Method

Definition

Check the script block to see if it uses any language constructs not allowed in restricted language mode.

public:
 void CheckRestrictedLanguage(System::Collections::Generic::IEnumerable<System::String ^> ^ allowedCommands, System::Collections::Generic::IEnumerable<System::String ^> ^ allowedVariables, bool allowEnvironmentVariables);
public void CheckRestrictedLanguage (System.Collections.Generic.IEnumerable<string> allowedCommands, System.Collections.Generic.IEnumerable<string> allowedVariables, bool allowEnvironmentVariables);
member this.CheckRestrictedLanguage : seq<string> * seq<string> * bool -> unit
Public Sub CheckRestrictedLanguage (allowedCommands As IEnumerable(Of String), allowedVariables As IEnumerable(Of String), allowEnvironmentVariables As Boolean)

Parameters

allowedCommands
IEnumerable<String>

The commands that are allowed.

allowedVariables
IEnumerable<String>

The variables allowed in this scriptblock. If this is null, then the default variable set will be allowed. If it is an empty list, no variables will be allowed. If it is "*" then any variable will be allowed.

allowEnvironmentVariables
Boolean

The environment variables that are allowed.

Applies to