Is there a way to extract the parameter list of a script block from outside the script block in PS 2.0 ?
Say we have
$scriptb = { PARAM($test) }
In Powershell 3.0 we can do this
$scriptb.Ast.ParamBlock.Parameters.Count == 1 #true
The Ast property however was included in powershel 3.0 so the above will not work in PS 2.0 https://msdn.microsoft.com/en-us/library/System.Management.Automation.ScriptBlock_properties%28v=vs.85%29.aspx
Do you know of a way to do this in PS 2.0 ?