Announcing PSReadLine 2.2-beta.2 with Dynamic help

Jason Helmick

Jason

We are pleased to announce the new feature Dynamic Help in PSReadLine 2.2.0-beta.2. Features like TabCompletetion and the Help system make PowerShell easier to use. Expanding on that theme, Dynamic Help provides just-in-time help at the command line. This experience allows you to stay focused on your work in the terminal without losing your place typing on the pipeline.

Supported Releases

Dynamic Help is implemented and presented through the PSReadLine module. In an effort to bring the benefits of Dynamic Help to the most users, Dynamic Help is supported down-level to Windows PowerShell 5.1.

PSReadLine 2.2.0-beta2, including Dynamic Help, is supported in the following versions:

  • Windows PowerShell 5.1
  • PowerShell 7.0+

Install PSReadLine with Dynamic Help

To receive the benefits of Dynamic Help, download and install the PSReadLine module from PSGallery.

Install-Module PSReadLine -AllowPrerelease

Getting Cmdlet Help

Dynamic Help provides a view of full cmdlet help shown on an alternative screen buffer using a cross platform Pager utility. PSReadLine maps the function ShowCommandHelp to the F1 key.

  • When the cursor is at the end of a fully expanded cmdlet, pressing F1 displays the help for that cmdlet.
  • When the cursor is at the end of a fully expanded parameter, pressing F1 displays the help beginning at the parameter.

Image DynHelp1

The Pager in PSReadLine supports viewing content one screen at a time. To navigate the displayed help content, press the up and down arrow keys to scroll the screen. Pressing Q exits the alternative screen buffer and returns to the current cursor location in the the primary screen buffer.

The Pager is a work in progress and we welcome your feedback and suggestions. To provide feedback and for more information, see the Pager repository on GitHub.

Focused Parameter Help

Pressing the Alt-h key combination provides dynamic help for parameters. The help is shown below the current command line like MenuComplete. The cursor must be at the end of the fully-expanded parameter name when you press the Alt-h key.

Image DynHelp Alt H

Note


The PSReadLine function ShowParameterHelp is bound to Alt-h. The Alt bindings do not currently work on macOS as detailed in this issue. Mac users will need to map ShowParameterHelp function to an available key combination.

Set-PSReadLineKeyHandler -chord "Ctrl-l" -Function ShowParameterHelp

Selection of Arguments

To rapidly select and change the arguments of a cmdlet without disturbing your syntax, press Alt-a. Selection of arguments is scoped within a script block. Based on the cursor position, it searches from the innermost script block to the outmost script block, and stops when it finds any arguments in a script block scope.

Image dynhelpA

Note


The PSReadLine function SelectCommandArgument is bound to Alt-a. The Alt bindings do not currently work on macOS as detailed in this issue. Mac users will need to map SelectCommandArgument function to an available key combination.

Set-PSReadLineKeyHandler -chord "Ctrl-k" -function SelectCommandArgument

Feedback and Support

Community feedback is essential to the iterative development of PSReadLine and features like Dynamic Help. Thank you for your continued support and engagement. To file issues for PSReadLine or Dynamic Help, please visit the PSReadLine repository.

Jason Helmick

PowerShell Team

1 comment

Comments are closed. Login to edit/delete your existing comments

  • Kashif Khan
    Kashif Khan

    Unable to install or update PSReadLine 2.2.0 beta2 on Windows 10.0.19042.0. I am getting following issue.

    Install-Package: C:\program files\powershell\7\Modules\PowerShellGet\PSModule.psm1:9711
    Line |
    9711 |  … talledPackages = PackageManagement\Install-Package @PSBoundParameters
         |                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         | Administrator rights are required to install or update. Log on to the computer with an account that has Administrator rights, and then try
         | again, or install by adding "-Scope CurrentUser" to your command. You can also try running the Windows PowerShell session with elevated
         | rights (Run as Administrator).