-
-
Save bielawb/42b98f4e84aa973a9fd15066a1582efc to your computer and use it in GitHub Desktop.
Wyszukiwanie definicji funkcji za pomocą AST
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ast = [System.Management.Automation.Language.Parser]::ParseFile($Path, [ref]$null, [ref]$null) | |
$definicja = $ast.FindAll( | |
{ | |
param ([System.Management.Automation.Language.Ast]$astElement) | |
$astElement -is [System.Management.Automation.Language.FunctionDefinitionAst] -and | |
$astElement.Name -eq $Name | |
}, | |
$false | |
) | Select-Object -Last 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment