I keep having to hit the enter key when the results are longer than my screen in Visual Studio Code.
Example Get-Help Remove-Item - detailed
How can I get all the results on the screen without having to hit enter on 'more' please?
Thanks for your help.
Note: The following applies to all PowerShell hosts (environments), not just Visual Studio Code.
The
Get-Help
cmdlet itself does not perform interactive pagination (waiting for a keypress before printing the next page).However, the built-in
help
function does: it (ultimately) pipes to themore.com
utility (on Windows); you can inspect the function definition with$function:help
.If you're really seeing pagination with
Get-Help
, the implication is that a custom command is shadowing theGet-Help
cmdlet (e.g., hypothetically, aGet-Help
function defined in your$PROFILE
file).Use
Get-Command -All Get-Help
to investigate the problem: if there are multiple results, they are shown in order of precedence; that is, the effective command is shown first.If you do want the
help
command to act likeGet-Help
- i.e. without pagination - you can define ahelp
alias, as shown in this SuperUser answer:Since an alias has a higher command-lookup precedence than a function (see
about_Command_Precedence
), thehelp
alias effectively overrides the built-inhelp
function.If you put the above command in your
$PROFILE
file,help
will act likeGet-Help
in all sessions (except those started with-NoProfile
). Note that Visual Studio Code's PowerShell extension has its own$PROFILE
file, distinct from that of PowerShell sessions in regular console windows.