File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -500,11 +500,19 @@ function Get-MarkdownHelp {
500500 # We decorate that object with the typename `PowerShell.Markdown.Help`.
501501 $helpObj.pstypenames.clear ()
502502 $helpObj.pstypenames.add (' PowerShell.Markdown.Help' )
503+ $IsHelpAboutAlias = $helpObj.Name -ne $gotHelp.Name
504+ $helpObj | Add-Member NoteProperty IsAlias $IsHelpAboutAlias - Force
505+ if ($IsHelpAboutAlias ) {
506+ $aliasCommand = $ExecutionContext.SessionState.InvokeCommand.GetCommand ($gotHelp.Name , ' Alias' )
507+ $helpObj | Add-Member NoteProperty AliasCommand $aliasCommand - Force
508+ }
503509
504510 # Then we attach parameters passed to this command to the help object.
505511 # * `-Rename` will become `[string] .Rename`
506512 if ($Rename ) {
507513 $helpObj | Add-Member NoteProperty Rename $Rename - Force
514+ } elseif ($IsHelpAboutAlias ) {
515+ $helpObj | Add-Member NoteProperty Rename $gotHelp.Name - Force
508516 }
509517
510518 # * `-SectionOrder` will become `[string[]] .SectionOrder`
You can’t perform that action at this time.
0 commit comments