Comment-Based Help: Are multiple-line examples supported?

Welcome Forums DSC (Desired State Configuration) Comment-Based Help: Are multiple-line examples supported?

This topic contains 2 replies, has 2 voices, and was last updated by

 
Participant
4 years, 3 months ago.

  • Author
    Posts
  • #18272

    Participant
    Points: 22
    Rank: Member

    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?

  • #18274

    Keymaster
    Points: 1,673
    Helping HandTeam Member
    Rank: Community Hero

    Nope.

  • #18275

    Participant
    Points: 22
    Rank: Member

    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.

The topic ‘Comment-Based Help: Are multiple-line examples supported?’ is closed to new replies.