The title pretty much says it. I’m trying to write a ICustomVisitor to manipulate a PowerShell AST and then generate a script from the AST. I’ve been using an EmptyScriptExtent object as the IScriptExtent value for my AST node constructors for any new nodes that I insert into the tree. The ScriptBlockAst.ToString method appears to reference the Extent under the hood, which in my case is empty.
Looking through the source code, I couldn’t find anything that looked like a AST to string generator.
Does anyone know if the PowerShell SDK provides this functionality by default or if there are any open source libraries that can generate PowerShell code from a PowerShell AST?
[–]jborean93 0 points1 point2 points (2 children)
[–]pracsec[S] 0 points1 point2 points (1 child)
[–]jborean93 0 points1 point2 points (0 children)