Function cross-reference list for a module

Welcome Forums General PowerShell Q&A Function cross-reference list for a module

This topic contains 3 replies, has 3 voices, and was last updated by

 
Participant
1 year ago.

  • Author
    Posts
  • #83108

    Participant
    Points: 0
    Rank: Member

    I've been put on a project that contains old code in a single module and many functions. Several of the functions call other functions several levels deep. Is there a way to generate a cross-reference list or where-used list of functions in a module showing what they call and where they are called from? This would help document the flow of the code when making changes.

    Regards,
    Jim

  • #83110

    Participant
    Points: 155
    Helping Hand
    Rank: Participant

    … not completely sure if it's what you want but you could give it a try. At least it's free of charge. 😉

    https://gallery.technet.microsoft.com/scriptcenter/Powershell-CodeManager-v5-47aa4af4

  • #83111

    Participant
    Points: 1
    Rank: Member

    visual studio code has some helpful features for finding code references. here's some of them:

    https://code.visualstudio.com/docs/editor/editingevolved

  • #83116

    Participant
    Points: 0
    Rank: Member

    The PowerShell CodeManager has close to what I'm looking for; a graphical chart of the functions that are called. Unfortunately this software appears to only document all of the functions contained in a single script file. I'm looking for similar capability at a module and function level diagram where functions are separate files. For example if I have a module with a controller script and 5 functions in separate files, I might see a diagram like this:

    [——-Script——-]
    .|.......|.......|
    [F1] [—F2—] [F5]
    .|....|....|
    [F3] [F4] [F5]
    .|
    [F5]

    The controller script calls functions F1, F2 and F5 directly.
    Function F2 calls functions F4 and F5.
    Function F3 calls function F5.
    (Diagram not showing well after it is posted)

The topic ‘Function cross-reference list for a module’ is closed to new replies.