Publish-IcingaForWindowsComponent - does not create a doc file

Hello

I created a plugin with the following description:

<#
.DESCRIPTION
Test Plugin
.PARAMETER Warning
Warning Threshold of Test Plugin
.PARAMETER Critical
Critical Threshold of Test Plugin
#>

When I do Publish-IcingaForWindowsComponent -Name ‘TestPlugins’ then no file is created under /doc/plugins.

The second time I run Publish-IcingaForWindowsComponent -Name ‘TestPlugins’ I get this error:
[Error]: A documentation object with the name “Invoke-IcingaCheckTest” does already exist in memory. Use -Force to overwrite it

I would appreciate any help, thank you!

Hello,

Thank you for your message.

Can you please make sure that you have only one new line between your documentation and your function.

<#
#>

function Invoke-IcingaCheckTestPluginMyPlugin()
{
}

There is an issue right now, that in case multiple new lines are in-between, the docs are not generated.
I hope this helps!

Thanks for the answer @cstein :+1:,
I checked the plugin but there is still no documentation created and the second time I run it I get the error:
[Error]: A documentation object with the name “Invoke-IcingaCheckTest” does already exist in memory. Use -Force to overwrite it

image

Can you please check if the file encoding is set to UTF8 and not UTF8-BOM or anything else.

I run into this on another environment previously.

encoding is set to UTF-8 but the error still occurs

Hi @cstein

I think I have found the error.
Is here in the
“C:\Program Files\WindowsPowerShell\Modules\icinga-powershell-framework\lib\core\framework\Publish-IcingaPluginDocumentation.psm1”

Or example is mandatory in the Command Help, then it also works

<#
.SYNOPSIS
    Template Plugin
.DESCRIPTION
    Template Plugin
.PARAMETER Warning
    Warning Threshold of Template Plugin
.PARAMETER Critical
    Critical Threshold of Template Plugin
.EXAMPLE
    Template
#>