PowerShellValue<T>.ValidateExpressionConstraints Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Check to see if the expression only uses elements of the restricted language as well as only using the allowed commands and variables.
public:
void ValidateExpressionConstraints(System::Collections::Generic::IEnumerable<System::String ^> ^ allowedCommands, System::Collections::Generic::IEnumerable<System::String ^> ^ allowedVariables, bool allowEnvironmentVariables);
public void ValidateExpressionConstraints (System.Collections.Generic.IEnumerable<string> allowedCommands, System.Collections.Generic.IEnumerable<string> allowedVariables, bool allowEnvironmentVariables);
member this.ValidateExpressionConstraints : seq<string> * seq<string> * bool -> unit
Public Sub ValidateExpressionConstraints (allowedCommands As IEnumerable(Of String), allowedVariables As IEnumerable(Of String), allowEnvironmentVariables As Boolean)
Parameters
- allowedCommands
- IEnumerable<String>
List of command names to allow in the expression
- allowedVariables
- IEnumerable<String>
List of variable names to allow in the expression. If the collection contains a single element "*", all variables will be allowed including environment variables functions, etc.
- allowEnvironmentVariables
- Boolean
If true, environment variables are allowed even if the allowedVariables list is empty.