- 
                Notifications
    You must be signed in to change notification settings 
- Fork 14
Open
Description
Prerequisites
- Write a descriptive title.
- Make sure you are able to repro it on the latest version
- Search the existing issues.
Steps to reproduce
Get-Help Find-Module
# Get-Help: ForwardHelpTargetName cannot refer to the function itself.It throws error in PowerShell Core 7.4.1 and in PowerShell Windows 5.1
The same problem exists for the other commands in PowerShellGet module
This is the ForwardHelpTargetName - CircularDependencyInHelpForwarding check:
https://github.com/PowerShell/PowerShell/blob/79639822c4302f9d3e46f14db50e246bac7c5e15/src/System.Management.Automation/help/CommandHelpProvider.cs#L450-L454
The latest Find-Module help target forwarding:
PowerShellGet/src/PowerShellGet.psm1
Lines 560 to 563 in fe34ca3
| <# | |
| .ForwardHelpTargetName Find-Module | |
| .ForwardHelpCategory Function | |
| #> | 
Expected behavior
Get-Help Remove-Module
NAME
    Remove-Module
SYNOPSIS
    Removes modules from the current session.
...Actual behavior
Get-Help Find-Module
Get-Help: ForwardHelpTargetName cannot refer to the function itself.Error details
Get-Error
Exception             :
    Type        : System.Management.Automation.PSInvalidOperationException
    ErrorRecord :
        Exception             :
            Type    : System.Management.Automation.ParentContainsErrorRecordException
            Message : ForwardHelpTargetName cannot refer to the function itself.
            HResult : -2146233087
        CategoryInfo          : InvalidOperation: (:) [], ParentContainsErrorRecordException
        FullyQualifiedErrorId : InvalidOperation
    TargetSite  :
        Name          : MoveNext
        DeclaringType : System.Management.Automation.CommandHelpProvider+<ExactMatchHelp>d__12, System.Management.Autom
ation, Version=7.4.1.500, Culture=neutral, PublicKeyToken=31bf3856ad364e35
        MemberType    : Method
        Module        : System.Management.Automation.dll
    Message     : ForwardHelpTargetName cannot refer to the function itself.
    Source      : System.Management.Automation
    HResult     : -2146233079
    StackTrace  :
   at System.Management.Automation.CommandHelpProvider.ExactMatchHelp(HelpRequest helpRequest)+MoveNext()
   at System.Management.Automation.CommandHelpProvider.ProcessForwardedHelp(HelpInfo helpInfo, HelpRequest helpRequest)
+MoveNext()
   at System.Management.Automation.HelpSystem.ForwardHelp(HelpInfo helpInfo, HelpRequest helpRequest)+MoveNext()
   at System.Management.Automation.HelpSystem.ExactMatchHelp(HelpRequest helpRequest)+MoveNext()
   at System.Management.Automation.HelpSystem.DoGetHelp(HelpRequest helpRequest)+MoveNext()
   at Microsoft.PowerShell.Commands.GetHelpCommand.ProcessRecord()
   at System.Management.Automation.CommandProcessor.ProcessRecord()
CategoryInfo          : InvalidOperation: (:) [Get-Help], PSInvalidOperationException
FullyQualifiedErrorId : InvalidOperation,Microsoft.PowerShell.Commands.GetHelpCommand
InvocationInfo        :
    MyCommand        : Get-Help
    ScriptLineNumber : 1
    OffsetInLine     : 1
    HistoryId        : 44
    Line             : Get-Help Find-Module
    Statement        : Get-Help Find-Module
    PositionMessage  : At line:1 char:1
                       + Get-Help Find-Module
                       + ~~~~~~~~~~~~~~~~~~~~
    InvocationName   : Get-Help
    CommandOrigin    : Internal
ScriptStackTrace      : at <ScriptBlock>, <No file>: line 1Environment data
Name                           Value
----                           -----
PSVersion                      7.4.1
PSEdition                      Core
GitCommitId                    7.4.1
OS                             Microsoft Windows 10.0.22631
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0Version
3.0.23-beta23
Visuals
devCKVargas
Metadata
Metadata
Assignees
Labels
No labels
