Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

Using dynamic help

Dynamic Help provides just-in-time help that allows you to stay focused on your work without losing your place typing on the command line.

Getting cmdlet help

Dynamic Help provides a view of full cmdlet help shown in an alternative screen buffer. PSReadLine maps the function ShowCommandHelp to the key.

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

👁 Full screen Dynamic help

The pager in PSReadLine allows you to scroll the displayed help using the up and down arrow keys. Pressing exits the alternative screen buffer and returns to the current cursor position on the command line on the primary screen.

Getting focused parameter help

Pressing + provides dynamic help for parameters. The help is shown below the current command line similar to MenuComplete. The cursor must be at the end of the fully expanded parameter name when you press the + key.

👁 Focused help for a parameter using Alt-h

Select arguments on the command line

To quickly select and edit the arguments of a cmdlet without disturbing your syntax, use +. It searches from the current cursor position and stops when it finds an argument on the command line. It selects the full argument, making it simple to replace or edit the argument.

👁 Argument selection using Alt-A

Choosing keybindings

Not all keybindings work for all operating systems and terminal applications. For example, keybindings for the key don't work on macOS by default. On Linux, + is the same as . And + generates a + key sequence instead of the + sequence expected.

To work around these quirks, map the PSReadLine function to an available key combination. For example:

Set-PSReadLineKeyHandler -Chord 'Ctrl+l' -Function ShowParameterHelp
Set-PSReadLineKeyHandler -Chord 'Ctrl+k' -Function SelectCommandArgument

For more information about keybindings and workarounds, see Using PSReadLine key handlers.


Feedback

Was this page helpful?

Additional resources