From 582edfa13a3592779860047f11f6e5e7902a2d3b Mon Sep 17 00:00:00 2001 From: Jacob Ernst <157037942+AT-jernst@users.noreply.github.com> Date: Fri, 19 Jan 2024 09:21:29 -0500 Subject: [PATCH 1/2] Update LogicApp.Doc.ps1 with code over pre Change the replacement of
to
---
src/LogicApp.Doc.ps1 | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/LogicApp.Doc.ps1 b/src/LogicApp.Doc.ps1
index eb42fc3..561c224 100644
--- a/src/LogicApp.Doc.ps1
+++ b/src/LogicApp.Doc.ps1
@@ -8,7 +8,7 @@ Document 'Azure-LogicApp-Documentation' {
$Json
)
- (($Json -replace '^{', '{') -replace '}$', '}') -replace '\r\n', '
'
+ (($Json -replace '^{', '{') -replace '}$', '}') -replace '\r\n', '
'
}
"# Azure Logic App Documentation - $($InputObject.LogicApp.name)"
@@ -34,8 +34,8 @@ $($InputObject.diagram)
Section 'Actions' {
$($InputObject.actions) |
Sort-Object -Property Order |
- Select-Object -Property 'ActionName', 'Type', 'RunAfter', @{Name = 'Inputs'; Expression = { Format-MarkdownTableJson -Json $($_.Inputs | ConvertFrom-Json | ConvertTo-Json -Depth 10) } } |
- Table -Property 'ActionName', 'Type', 'RunAfter', 'Inputs'
+ Select-Object -Property 'ActionName', 'Comment', 'Type', 'RunAfter', @{Name = 'Inputs'; Expression = { Format-MarkdownTableJson -Json $($_.Inputs | ConvertFrom-Json | ConvertTo-Json -Depth 10)} } |
+ Table -Property 'ActionName', 'Comment', 'Type', 'RunAfter', 'Inputs'
}
}
@@ -50,4 +50,4 @@ $($InputObject.diagram)
}
}
}
-}
\ No newline at end of file
+}
From f0ea085f78aafe446b738f1ef05b8d92ea8759be Mon Sep 17 00:00:00 2001
From: Jacob Ernst <157037942+AT-jernst@users.noreply.github.com>
Date: Fri, 19 Jan 2024 09:22:20 -0500
Subject: [PATCH 2/2] Added switch to replace \u0027 with '
added a switch to replace \u0027 with ' globally
---
src/New-LogicAppDoc.ps1 | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/src/New-LogicAppDoc.ps1 b/src/New-LogicAppDoc.ps1
index 816ae48..c3168d2 100644
--- a/src/New-LogicAppDoc.ps1
+++ b/src/New-LogicAppDoc.ps1
@@ -23,7 +23,10 @@ Param(
[string]$LogicAppName,
[Parameter(Mandatory = $false)]
- [string]$OutputPath = (Get-Location).Path
+ [string]$OutputPath = (Get-Location).Path,
+
+ [Parameter(Mandatory = $false)]
+ [switch]$replaceU0027
)
Set-StrictMode -Version 3.0
@@ -244,4 +247,11 @@ $invokePSDocumentSplat = @{
}
$markDownFile = Invoke-PSDocument @invokePSDocumentSplat
Write-Host ('Logic App Workflow Markdown document is being created at {0}' -f $($markDownFile.FullName)) -ForegroundColor Green
-#endregion
\ No newline at end of file
+#endregion
+
+#region replace \u0027 with ' in Markdown documentation for Logic App Workflow
+if($replaceU0027){
+ $pathToDocumentationFile = ($OutputPath + $LogicAppName + ".md")
+ $documentationFileData = Get-Content -Path $pathToDocumentationFile
+ $documentationFileData -replace '\\u0027' , "'" | set-content -path $pathToDocumentationFile
+}