Open ghost opened 4 years ago
converting an array of c# objects is probably unknown to confluence. what is the output that you are expecting?
if you are looking for a able format, try this:
[PSCustomObject]@{
Path = 'C:\Temp\Test.txt' #[System.String]
LastAccessTime = '12.11.2035' #[System.DateTime]
},
[PSCustomObject]@{
Path = 'C:\Temp\Test.txt' #[System.String]
LastAccessTime = '12.11.2035' #[System.DateTime]
} | ConvertTo-ConfluenceTable | ConvertTo-ConfluenceStorageFormat
I would expect the following Output:
<p><#<br/>
.NOTES<br/>
===========================================================================<br/>
Created on:<br/>
Created by:<br/>
Created for:<br/>
===========================================================================<br/>
.DESCRIPTION</p>
<p> [PSCustomObject[]]$FileToExtend = @(<br/>
[PSCustomObject]@{<br/>
Path = 'C:\Temp\Test.txt' #[System.String]<br/>
LastAccessTime = '12.11.2035' #[System.DateTime]<br/>
},<br/>
[PSCustomObject]@{<br/>
Path = 'C:\Temp\Test.txt' #[System.String]<br/>
LastAccessTime = '12.11.2035' #[System.DateTime]<br/>
}<br/>
)<br/>
<p>
#></p>
The problem with your case is the chars that confluence tries to convert into macros.
This works for me using your $JobDescription
:
ConvertTo-ConfluenceStorageFormat ($JobDescription -replace "#", "#" -replace "@", "@" -replace "\[", "&#
91;" -replace "\{", "{")
Thank you Oliver, that works for me. I created a pull request (https://github.com/AtlassianPS/ConfluencePS/pull/178). Would be nice to add the ability to handle this cases directly with the function ConvertTo-ConfluenceStorageFormat
.
Description
Converting a string to confluence storage format with
ConvertTo-ConfluenceStorageFormat
returns the errorcom.atlassian.confluence.content.render.xhtml.migration.exceptions.UnknownMacroMigrationException
.Steps To Reproduce
Expected Output
Your Environment
Confluence 7.0.1