From 995101698b7ee33950ac981d147c1f9c4715e44a Mon Sep 17 00:00:00 2001 From: Felix Melchert <42865061+FelixMelchert@users.noreply.github.com> Date: Wed, 5 Sep 2018 09:36:16 +0200 Subject: [PATCH] fix for tables with empty cells if the input object contains empty cells the function throws an error or creates tables with nested tables instead empty cells. with this fix empty cells are filled with an space. this solves both problems. --- ConfluencePS/Public/ConvertTo-Table.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ConfluencePS/Public/ConvertTo-Table.ps1 b/ConfluencePS/Public/ConvertTo-Table.ps1 index 27820b8..d9d3bff 100644 --- a/ConfluencePS/Public/ConvertTo-Table.ps1 +++ b/ConfluencePS/Public/ConvertTo-Table.ps1 @@ -38,7 +38,7 @@ function ConvertTo-Table { } $_.PSObject.Properties | ForEach-Object -Begin {$Row = ""} ` - -Process {$Row += "|$($_.Value)"} ` + -Process {if ($($_.value)) {$Row += "|$($_.Value)"} else {$Row += "| "}} ` -End {$Row += "|"} $RowArray.Add($Row) | Out-Null }