在PowerShell中,如何获得有关“更多”命令用法的帮助?

时间:2012-04-30 16:47:58

标签: powershell

当我使用more时,最常见的是通过help,某些键可以执行特殊操作( q 结束more命令,输入向下滚动等。)。

PowerShell本身是否有办法获取这些密钥的帮助,还是我需要谷歌吗?

1 个答案:

答案 0 :(得分:7)

Powerhsell中的

more只是一个具有以下定义的函数:

param([string[]]$paths)
$OutputEncoding = [System.Console]::OutputEncoding

if($paths)
{
    foreach ($file in $paths)
    {
        Get-Content $file | more.com
    }
}
else
{
    $input | more.com
}

因此,在命令行中,您应该可以执行more.com /?并查看帮助,其中包含以下文本,这是您要查找的内容:

If extended features are enabled, the following commands
are accepted at the -- More -- prompt:

P n     Display next n lines
S n     Skip next n lines
F       Display next file
Q       Quit
=       Show line number
?       Show help line
<space> Display next page
<ret>   Display next line