diff --git a/Documentation.md b/Documentation.md index 8933379..1dc4813 100644 --- a/Documentation.md +++ b/Documentation.md @@ -17,7 +17,8 @@ A module for simplifying the process of getting an access token from Entra ID ### SYNTAX ``` -Invoke-LCWMermaidGenerator [[-ReportPath] ] [-ProgressAction ] [] +Invoke-LCWMermaidGenerator [[-ReportPath] ] [-AzureDevOps] [-ProgressAction ] + [] ``` ### DESCRIPTION @@ -34,6 +35,21 @@ PS C:\> {{ Add example code here }} ### PARAMETERS +#### -AzureDevOps + + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + #### -ReportPath diff --git a/LCWMermaidGenerator/Private/ConvertTo-WorkflowMarkdown.ps1 b/LCWMermaidGenerator/Private/ConvertTo-WorkflowMarkdown.ps1 index 9750e9f..77c212f 100644 --- a/LCWMermaidGenerator/Private/ConvertTo-WorkflowMarkdown.ps1 +++ b/LCWMermaidGenerator/Private/ConvertTo-WorkflowMarkdown.ps1 @@ -1,6 +1,7 @@ function ConvertTo-WorkflowMarkdown { param( - $WorkflowRecord + $WorkflowRecord, + [switch] $AzureDevOps ) $lines = [System.Collections.Generic.List[string]]::new() @@ -58,9 +59,16 @@ function ConvertTo-WorkflowMarkdown { $lines.Add('### Mermaid') $lines.Add('') - $lines.Add('```mermaid') - $lines.Add((ConvertTo-WorkflowMermaid -WorkflowRecord $WorkflowRecord)) - $lines.Add('```') + if ($AzureDevOps) { + $lines.Add(':::mermaid') + $lines.Add((ConvertTo-WorkflowMermaid -WorkflowRecord $WorkflowRecord)) + $lines.Add(':::') + } + else { + $lines.Add('```mermaid') + $lines.Add((ConvertTo-WorkflowMermaid -WorkflowRecord $WorkflowRecord)) + $lines.Add('```') + } $lines.Add('') return ($lines -join [Environment]::NewLine) diff --git a/LCWMermaidGenerator/Public/Invoke-LCWMermaidGenerator.ps1 b/LCWMermaidGenerator/Public/Invoke-LCWMermaidGenerator.ps1 index 3f73a56..57587ba 100644 --- a/LCWMermaidGenerator/Public/Invoke-LCWMermaidGenerator.ps1 +++ b/LCWMermaidGenerator/Public/Invoke-LCWMermaidGenerator.ps1 @@ -1,7 +1,8 @@ function Invoke-LCWMermaidGenerator { [CmdletBinding()] param ( - [string] $ReportPath = 'LifecycleWorkflowsReport.md' + [string] $ReportPath = 'LifecycleWorkflowsReport.md', + [switch] $AzureDevOps ) process { @@ -47,7 +48,7 @@ function Invoke-LCWMermaidGenerator { $reportSections.Add('') foreach ($workflowRecord in $workflowRecords) { - $reportSections.Add((ConvertTo-WorkflowMarkdown -WorkflowRecord $workflowRecord)) + $reportSections.Add((ConvertTo-WorkflowMarkdown -WorkflowRecord $workflowRecord -AzureDevOps:$AzureDevOps)) } $reportContent = $reportSections -join [Environment]::NewLine