Get-MFDependencyTree
SYNOPSIS
Generate a dependency tree of ModuleForge PowerShell scripts, either in terminal or a mermaid flowchart
SYNTAX
Get-MFDependencyTree [[-ReferenceData] <Object[]>] [[-OutputType] <String>]
[-ProgressAction <ActionPreference>] [<CommonParameters>]
DESCRIPTION
The `Get-MFDependencyTree` function processes an array of objects representing PowerShell scripts and their dependencies. It generates a visual representation of the dependency tree, either as a text-based tree in the terminal or as a Mermaid diagram. This function helps in understanding the relationships and dependencies between different scripts and modules in a project.
EXAMPLES
EXAMPLE 1
$folderItemDetails = Get-MFFolderItemDetails -Path (get-item .\source).fullname
Get-MFDependencyTree ($folderItemDetails|Select-Object relativePath,dependencies)
DESCRIPTION
Show files and any dependencies
PARAMETERS
-ReferenceData
What Reference Data are we looking at. See function example for how to retrieve
Type: Object[]
Parameter Sets: (All)
Aliases:
Required: False
Position: 1
Default value: (get-mfFolderItemDetails -path (get-item source).fullname)
Accept pipeline input: True (ByValue)
Accept wildcard characters: False
-OutputType
Output format - ‘Terminal’ prints a text-based dependency tree, ‘Mermaid’ outputs a flowchart, ‘MermaidMarkdown’ wraps the flowchart in a markdown code block for embedding in docs
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 2
Default value: Terminal
Accept pipeline input: False
Accept wildcard characters: False
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
INPUTS
[OBJECT[]] - ReferenceData Object Array (Resulting from get-mfFolderItemDetails) accepted as pipeline input
OUTPUTS
[STRING] - Returns a formatted string representing the dependency tree, Output format can be:
- Multi-line string expected to print to terminal (Default Behaviour)
- A mermaid chart (If specified with Output Type ‘Mermaid’)
- A mermaid chart encapsulated in a markdown code block (‘MermaidMarkdown’)
NOTES
Author: Adrian Andersson