Ast.Find(Func<Ast,Boolean>, Boolean) Method

Definition

Traverse the entire Ast, returning the first node in the tree for which predicate returns true.

public:
 System::Management::Automation::Language::Ast ^ Find(Func<System::Management::Automation::Language::Ast ^, bool> ^ predicate, bool searchNestedScriptBlocks);
public System.Management.Automation.Language.Ast Find (Func<System.Management.Automation.Language.Ast,bool> predicate, bool searchNestedScriptBlocks);
member this.Find : Func<System.Management.Automation.Language.Ast, bool> * bool -> System.Management.Automation.Language.Ast
Public Function Find (predicate As Func(Of Ast, Boolean), searchNestedScriptBlocks As Boolean) As Ast

Parameters

predicate
Func<Ast,Boolean>

The predicate.

searchNestedScriptBlocks
Boolean

Search nested functions and script block expressions.

Returns

Ast

The first matching node, or null if there is no match.

Applies to