Powershell help module not able to find help files in MacOS

Viewed 23

I am running PowerShell Core 7.2.6 installed via homebrew on MacBook Air M1 (12.6). However, when I try to use the help module to find some examples , I get this error.

REMARKS
Get-Help cannot find the Help files for this cmdlet on this computer. It 
is displaying only partial help.
    -- To download and install Help files for the module that includes 
this cmdlet, use Update-Help.
    -- To view the Help topic for this cmdlet online, type: "Get-Help 
Find-Module -Online" or
       go to https://go.microsoft.com/fwlink/?LinkID=398574.

I have tried to update the help module but no luck, same with uninstalling it and reinstalling it.

1 Answers

It is implied by the Get-Help error message you're seeing, but to spell it out in more detail:

  • The command you're trying to invoke help for is a cmdlet and therefore part of a module.

  • That module's manifest defines an online help source, via its HelpInfoURI entry, but no local (offline) help content has ever been downloaded.

    • This is typical for the built-in modules that come with PowerShell (Core) 7+, the only edition available on non-Windows platforms such as macOS.
    • It can conceivably also happen with third-party modules, although the ones available via the PowerShell Gallery and installed via Install-Module usually come bundled with their offline help content.

As the error message suggests, Update-Help must be used to download such help content on demand; see the next section for details and general troubleshooting tips.

However, the problem in your specific case - trying to invoke local help for the Find-Module cmdlet - is that the downloadable help content for the specific PowerShellGet module that the Find-Module cmdlet is a part of appears to be broken as of this writing.

If you run the following command, you'll see that Update-Help downloads help content, but it seemingly isn't recognized; that is, running Update-Help makes no effective difference.

# Output shows that the following file is updated:
#  $HOME/.local/share/powershell/Help/PowerShellGet/en-US/PSModule-help.xml
Update-Help -Force -Verbose -Module PowerShellGet 

Therefore:

  • I encourage you to report an issue in PowerShellGet's GitHub repo.

  • As a workaround - assuming you're connected to the internet - use the -Online switch for now so as to open the help content in your default web browser (you cannot directly pass -Examples then, but just click the "Examples" link on the right-hand side to jump to the examples section).


Using and troubleshooting Update-Help:

  • Note that there is no help module as such (it sounds like you meant the help command, which is a function wrapper around Get-Help that provides interactive paging of long output from the latter). There's the Get-Help cmdlet that is part of the Microsoft.PowerShell.Core module, and there's downloaded help content, which you may have to download on demand via Update-Help:

    • Update-Help without a -Scope argument in PowerShell (Core) 7+ defaults to -Scope CurrentUser, which means that the help content is downloaded to a user-specific location.

    • With -Scope AllUsers (the default in Windows PowerShell, where no -Scope parameter exists), you need to run with elevation (as admin) on Windows, and via sudo powershell on macOS and Linux.

    • Use -Force to ensure that content is always downloaded, if available. According to the docs, -Force bypasses two built-in constraints: permitting only a single run per day, and limiting the download data volume to 1GB (though exceeding that seems unlikely).

    • Add -Verbose to get details about the operations performed by Update-Help, which includes the modules targeted and their online source URLs, as well as whether updated content was found and downloaded.

    • You can also limit Update-Help to updating the help for (a) given module(s) (-Module) and/or specific cultures (human languages) (-UICulture).

      • To learn the name of a module that a given command is part of, if any, use the following, using Get-Content as an example: (Get-Command Get-Content).Module.Name; note that you must use the actual command name, not an alias for it (such as gc); for an alias, use something like (Get-Command gc).ResolvedCommand.Module.Name

      • By default, content matching the current UI culture (as reflected in $PSUICulture) is downloaded; if no such content is available, but the content is available for other UI cultures, the resulting error message will list those.

  • However, even then it isn't guaranteed that help becomes available for all commands available in your session, given that implementing command-line help is optional (though recommended).

    • If there's no error message when you run Update-Help -Force yet no help content becomes available, the implication is that no online source for a module that a given command is part of, if any, is defined.

      • However, if you target such a module explicitly with -Module, the absence of an online source does result in an error to that effect.

      • It is the HelpInfoURI entry in a module's manifest that defines an online help source.

    • If an online source is defined, but not reachable / doesn't have the expected content, you'll get an error message.

Related