I want to create an inventory of all the functions we have in our Scripts library

Hi,

We have a lot of Scripts in DialogScripts but inside these scripts there might be multiple functions that can be called.

Is there a way SQL/Vb.net/Powershell to retrieve all the methods and parameters?

I have access to the ScriptClass ( $scriptClass = $Session.Scripts.get_item("Scripts") With this I can call an existing script and get the parameters ( $Parameters = ($scriptClass.Item($ScriptName).GetParameters() )

But when I use this I need to know the name of the function.

How can I retrieve a list of all the (custom) functions within our OneIdentity Script library?

I hope you can help. Thanks!

Parents Reply Children
  • Hello Patrick,

    I gave it a try. For the class DynScripts.ProductScripts it list all the OOTB functions/subs
    but for the custom scripts class 'DynScripts.CustomerScripts' I get is not defined.

    Public Sub CCC_ListMethods()
     
    Dim methods As New List(Of String) 
    Dim myType As Type = GetType(DynScripts.ProductScripts)
    'Dim myType As Type = GetType(DynScripts.CustomerScripts)
    Dim myArrayMethodInfo As MethodInfo() = myType.GetMethods()
    Dim i As Integer
            For i = 0 To myArrayMethodInfo.Length - 1
                Dim myMethodInfo As MethodInfo = CType(myArrayMethodInfo(i), MethodInfo)
               methods.Add((ControlChars.Cr + "The name of the method is " & myMethodInfo.Name & "."))
    Next i
    Throw New Exception(String.Join(System.Environment.NewLine, methods))
    End Sub