none
Where did Aliases go in Get-Help RRS feed

  • Question

  • I've added an alias to a function and it shows up in Get-Help

    function Do-Something{
    <#
    #>
        [CmdletBinding()]
        [Alias("DoingIt")]
        PARAM (
            $Param1
        )
        Write-Output "Param1 = $param1"
    }

    ----------------------------------------------------------------------------------------

    PS C:\> Get-Help Do-Something

    NAME
        Do-Something

    SYNTAX
        Do-Something [[-Param1] <Object>]  [<CommonParameters>]


    ALIASES
        DoingIt


    REMARKS
        None

    ----------------------------------------------------------------------------------------

    When I add anything to the Help/Comments section of the function and issue the Get-Help command, the ALIASES is not dynamically Generated, nor do I see a way to add it to the Help section I.e.  .ALIASES DoingIt

    function Do-Something{
    <#
    .NOTES
    Adding anything in this section KILLs the auto generation of the defined ALIASES in Get-Help Do-Something
    #>
        [CmdletBinding()]
        [Alias("DoingIt")]
        PARAM (
            $Param1
        )
        Write-Output "Param1 = $param1"
    }

    ----------------------------------------------------------------------------------------

    PS C:\> Get-Help Do-Something

    NAME
        Do-Something

    SYNOPSIS


    SYNTAX
        Do-Something [[-Param1] <Object>] [<CommonParameters>]


    DESCRIPTION


    RELATED LINKS

    REMARKS
        To see the examples, type: "get-help Do-Something -examples".
        For more information, type: "get-help Do-Something -detailed".
        For technical information, type: "get-help Do-Something -full".

    ----------------------------------------------------------------------------------------

    Anyone know how to get around this? It seems like an omission or bug in the Get-Help cmdlet.

    • Moved by Bill_Stewart Wednesday, May 9, 2018 2:43 PM Abandoned
    Wednesday, March 21, 2018 7:12 PM

All replies

  • This has been an issue with various versions of comment help.  Most have been fixed.  Here is the workaround for this glitch.

    function Do-Something{
    <#
        .ALIAS
            an alias
        
        .NOTES
            Additional information about the function.
    #>
        [CmdletBinding()]
        [Alias("DoingIt")]
        PARAM (
            [Parameter()]
            $Param1
        )
        Write-Output "Param1 = $param1"
    }

    Generally speaking ... if we don't use all help keywords various things are skipped.


    \_(ツ)_/

    Wednesday, March 21, 2018 10:16 PM