2016-07-26 70 views

回答

2

PowerShell使用分页预先定义的函数more()(它调用寻呼机more.com随Windows):

PS C:\>(Get-Item function:more).Definition 
param([string[]]$paths) 

$OutputEncoding = [System.Console]::OutputEncoding 

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

您可以通过为自己选择的程序或函数定义别名来覆盖它(因为别名优先于函数)。例如:

Set-Alias more 'C:\path\to\less.exe' 

或者你可以用自己的实现替换功能:

Remove-Item function:more 

function more { 
    # your implementation here 
} 

无论哪种方式,你会通过将其加入你的profile持续的变化。

相关问题