Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion Documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ A module for simplifying the process of getting an access token from Entra ID
### SYNTAX

```
Invoke-LCWMermaidGenerator [[-ReportPath] <String>] [-ProgressAction <ActionPreference>] [<CommonParameters>]
Invoke-LCWMermaidGenerator [[-ReportPath] <String>] [-AzureDevOps] [-ProgressAction <ActionPreference>]
[<CommonParameters>]
```

### DESCRIPTION
Expand All @@ -34,6 +35,21 @@ PS C:\> {{ Add example code here }}

### PARAMETERS

#### -AzureDevOps


Comment on lines +39 to +40
```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

#### -ReportPath


Expand Down
16 changes: 12 additions & 4 deletions LCWMermaidGenerator/Private/ConvertTo-WorkflowMarkdown.ps1
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
function ConvertTo-WorkflowMarkdown {
param(
$WorkflowRecord
$WorkflowRecord,
[switch] $AzureDevOps
)

$lines = [System.Collections.Generic.List[string]]::new()
Expand Down Expand Up @@ -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('```')
}
Comment on lines +62 to +71
$lines.Add('')

return ($lines -join [Environment]::NewLine)
Expand Down
5 changes: 3 additions & 2 deletions LCWMermaidGenerator/Public/Invoke-LCWMermaidGenerator.ps1
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
function Invoke-LCWMermaidGenerator {
[CmdletBinding()]
param (
[string] $ReportPath = 'LifecycleWorkflowsReport.md'
[string] $ReportPath = 'LifecycleWorkflowsReport.md',
[switch] $AzureDevOps
)

process {
Expand Down Expand Up @@ -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
Expand Down
Loading