FunctionDefinitionAst Constructor

Definition

Construct a function definition.

public:
 FunctionDefinitionAst(System::Management::Automation::Language::IScriptExtent ^ extent, bool isFilter, bool isWorkflow, System::String ^ name, System::Collections::Generic::IEnumerable<System::Management::Automation::Language::ParameterAst ^> ^ parameters, System::Management::Automation::Language::ScriptBlockAst ^ body);
public FunctionDefinitionAst (System.Management.Automation.Language.IScriptExtent extent, bool isFilter, bool isWorkflow, string name, System.Collections.Generic.IEnumerable<System.Management.Automation.Language.ParameterAst> parameters, System.Management.Automation.Language.ScriptBlockAst body);
new System.Management.Automation.Language.FunctionDefinitionAst : System.Management.Automation.Language.IScriptExtent * bool * bool * string * seq<System.Management.Automation.Language.ParameterAst> * System.Management.Automation.Language.ScriptBlockAst -> System.Management.Automation.Language.FunctionDefinitionAst
Public Sub New (extent As IScriptExtent, isFilter As Boolean, isWorkflow As Boolean, name As String, parameters As IEnumerable(Of ParameterAst), body As ScriptBlockAst)

Parameters

extent
IScriptExtent

The extent of the function definition, starting with the function or filter keyword, ending at the closing curly.

isFilter
Boolean

True if the filter keyword was used.

isWorkflow
Boolean

True if the workflow keyword was used.

name
String

The name of the function.

parameters
IEnumerable<ParameterAst>

The parameters specified after the function name. This does not include parameters specified with a param statement.

body
ScriptBlockAst

The body of the function/filter.

Exceptions

If extent, name, or body is null, or if name is an empty string.

Applies to