Search code examples
powershellmanpage

How to page up or down in `man` of powershell


With command help or its alias man, we can display the docs of a command in shell. But how to browse it? I found we can go to next line by pressing <Enter> or jump by <p>, but how to page up?


Solution

  • You just scroll with your mouse.

    I know, I know, you come potentially from another platform (where you always want fingers on the keyboard) and want that here.

    Well, life often does not give us what we may want. ;-}, so, we have to deal with what is. ;-}

    Yet, in the Windows Terminal using the WinPS or PSCore console, you just use the hotkeys:

    Crtl+Shift+up arrow
    Crtl+Shift+down arrow
    

    It's actually the help files, shortcut listing.

    If you feel TLDR regarding the MS PS docs, just as the console for a list:

    For example for PSReadLine which is in WinPS and PSCore.

    Get-PSReadlineKeyHandler | 
    Format-Table -Property Key, Function -Autosize
    

    Or use Out-GridView to filter what you'd need to learn to use:

    Get-PSReadLineKeyHandler | 
    Out-GridView -Title 'Consolehost Keyboard Shortcuts'
    

    The WinPS ISE has a similar command to see all the keyboard shortcuts there as well.