Author Posts

August 22, 2014 at 10:22 am

Does comment-based help support multiple line examples? It seems the parsers assumes the first line after .EXAMPLE is code, and the rest are remarks, so this:

.EXAMPLE
> line1
> line2

Demonstrates how to use the command.

Is output as:

————————– EXAMPLE 1 ————————–

>line1

> line2

Note the two lines between line 1 and line 2. Is there anything I can do to tell the comment-based help parser that my code spans multiple lines?

August 22, 2014 at 12:43 pm

Sad trombone. I've requested this feature on Microsoft Connect.

In the meantime, this is how I've worked around it:

.EXAMPLE
>
Carbon_EnvironmentVariable RemoveCarbonEnv
{
    Name = 'CARBON_ENV';
    Ensure = 'Absent';
}

Demonstrates how to remove an environment variable.

I leave the code line blank, and put my code block immediately after. It displays like this:

- EXAMPLE 1 -
    
>
    
Carbon_EnvironmentVariable SetCarbonEnv
{
    Name = 'CARBON_ENV';
    Value = 'developer';
    Ensure = 'Present';
}

Demonstrates how to create or update an environment variable.

Which isn't ideal, but works.