Skip to content

Offline help topics do not state parameter aliases, even with "Get-Help -Full"; consider including aliases in the "-Detailed" view #1638

Closed

Description

The offline help topics do not include parameter aliases, even when Get-Help -Full is used -
though alias names may be mentioned in the description, that's usually limited to one alias, and often they're not mentioned at all.

By contrast, the online topics do; e.g., for Get-ChildItem's -Directory switch parameter.

This makes it difficult to discover parameter aliases offline.

Additionally, consider including the alias names (more formally and consistently) in the -Detailed offline view; e.g.:

Instead of:

    -Directory [<SwitchParameter>]

consider:

    -Directory [<SwitchParameter>]  /  -ad [<SwitchParameter>]  /  -d [<SwitchParameter>] 

or something similar.

Activity

  1. changed the title [-]Offline help topics do not state parameter aliases, even with "Get-Help -Full"; consider including aliases in the `-Detailed` view[/-] [+]Offline help topics do not state parameter aliases, even with "Get-Help -Full"; consider including aliases in the "-Detailed" view[/+] on Sep 1, 2017
  2. zjalexander commented on Oct 11, 2017

    @zjalexander
    Contributor

    Clarifying question: Is the behavior you're talking about happening when update-help has not been run? Or is it after update-help has run and you are not using the -Online switch? This will determine if this is a help content issue or if this is a code issue in get-help.

  3. mklement0 commented on Oct 11, 2017

    @mklement0
    ContributorAuthor

    The behavior is unrelated to Update-Help or -Online.

    Local Get-Help, with the help topic present and even with -Full, simply doesn't display information about parameter aliases - it appears not be part of the output format - hence the suggestion to amend that format to include the alias names.

  4. zjalexander commented on Oct 18, 2017

    @zjalexander
    Contributor

    We took a look and it's not clear:

    1. Is this PlatyPS's fault for not picking up the alias?
    2. Is this get-help's fault for not displaying everything in the YAML block?
    3. When there's no local help (update-help not run), does the issue come up? If the issue repros, shouldn't get-help be able to reflect aliases?
  5. mklement0 commented on Oct 19, 2017

    @mklement0
    ContributorAuthor

    Sorry - I should have made it clearer that this is a suggested enhancement.

    I don't know how the help sausage is made, but it appears to me that the local help is currently not designed to show alias parameters - unlike the online help pages.

    Given that knowing a parameter's aliases is helpful and the information is currently difficult to obtain locally, my suggestion is to enhance the local help format to include parameter aliases, as described in the original post - optionally in the new format I suggest.

    To contrast the current local help with the online version:


    LOCAL: Snippet from Get-Help -Full Get-ChildItem (as of PowerShell Core v6.0.0-beta.8):

    NO mention of aliases; also note the broken description ({{Fill Directory Description}}):

        -Directory [<SwitchParameter>]
            {{Fill Directory Description}}
            
            Required?                    false
            Position?                    named
            Default value                False
            Accept pipeline input?       False
            Accept wildcard characters?  false

    ONLINE: Snippet from https://github.com/PowerShell/PowerShell-Docs/blob/staging/reference/6/Microsoft.PowerShell.Management/Get-ChildItem.md:

    Note the Alias: ad, d line:

    Type: SwitchParameter
    Parameter Sets: (All)
    Aliases: ad, d
    
    Required: False
    Position: Named
    Default value: None
    Accept pipeline input: False
    Accept wildcard characters: False
  6. mklement0 commented on Feb 18, 2018

    @mklement0
    ContributorAuthor

    From what I can tell, this is fixed as of (at least) PowerShell Core v6.0.1 - thanks!

    E.g., the following commands now work as intended - note the 'Aliases ' output lines:

    PS> Get-Help Get-ChildItem -full | Out-String -Stream | Select-String '^\s+-Directory' -context 0,8
    
    >     -Directory
              
              Required?                    false
              Position?                    Named
              Accept pipeline input?       false
              Parameter set name           (All)
              Aliases                      ad, d
              Dynamic?                     true
    PS> Get-Help Get-ChildItem -Parameter Directory 
    
    -Directory
        
        Required?                    false
        Position?                    Named
        Accept pipeline input?       false
        Parameter set name           (All)
        Aliases                      ad, d
        Dynamic?                     true
        
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Pri3

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions