Bug in comment based Help with Functions

This topic contains 0 replies, has 1 voice, and was last updated by Profile photo of Forums Archives Forums Archives 5 years, 4 months ago.

  • Author
    Posts
  • #5328

    by Peter-Kriegel at 2012-12-07 01:38:04

    Hi!

    I like to document my Functions with Comment based help!
    Every time i Use .EXAMPLE the Help is not showed!
    is that a Bug!? how to solve or workaround!?

    Function Foo {
    < #
    .SYNOPSIS
    This Function is without sense

    .DESCRIPTION
    This Function is without sense. The answer is 42!

    .PARAMETER Bar
    Parameter where you can order beer!

    .EXAMPLE 1
    PS C:\> Foo -Bar 'Guinness'

    The Example shows hot to order Guinness beer from the Bartender

    .NOTES
    Author: Peter Kriegel http://www.admin-source.de

    #>

    param (
    [String]$Bar = ''
    )

    Process {
    "Drink to much $Bar"
    }
    }

    Get-Help Foo -full

    If i remove the .EXAMPLE section the Help is showing proper!

    by Peter-Kriegel at 2012-12-07 01:45:41

    Have it!

    The fault was the Number after the EXAMPLE!
    This works fine:
    Function Foo {
    < #
    .SYNOPSIS
    This Function is without sense

    .DESCRIPTION
    This Function is without sense. The answer is 42!

    .PARAMETER Bar
    Parameter where you can order beer!

    .EXAMPLE
    PS C:\> Foo -Bar 'Guinness'

    The Example shows hot to order Guinness beer from the Bartender

    .NOTES
    Author: Peter Kriegel http://www.admin-source.de

    #>

    param (
    [String]$Bar = ''
    )

    Process {
    "Drink to much $Bar"
    }
    }

    Get-Help Foo -full

You must be logged in to reply to this topic.