Hi…
I’m trying to parse the PowerShell code in a PowerShell project, in order to generate a graph visualization over the ‘function hierarchy / call-graph hierarchy’ of the PowerShell code. This would be of great help in documenting and understanding the code in a PowerShell project.
I’ve considered various ways to go at the problem. Where I’m currently at is: I’m going to parse PowerShell code with PowerShell code that looks at the AST and then generate the graph visualization with graphviz. The challenge is how to avoid endless loops and other similar issues when parsing the code. I’m thinking of using the theory of ‘directed acyclic graph’ (Directed acyclic graph - Wikipedia). Thinking that implementing this in code will make it possible to stop parsing ‘x’ code if it would result in a cyclic loop…
So, I’m seeking your guidance on if this is a proper approach. Also, if someone here has experience in doing this, or something similar, advice would be greatly appreciated
I hope I have made myself understandable and I’m looking forward to read your comments and ideas.
Thank you very much.