Equivalent of 'more' or 'less' command in Powershell?

后端 未结 12 2074
小蘑菇
小蘑菇 2020-12-13 01:38

Is there a way to paginate the output by piping it to some \'more\' command, which is available in linux\\unix shells?

12条回答
  •  甜味超标
    2020-12-13 01:43

    Suggestion: Put the file into a temporary/disposable .txt file, then let the OS invoke your favorite editor, the one that is linked to the .txt extension.

    Get-Process | Out-File temp.txt ; .\temp.txt

    Note: each time you use this you will overwrite any pre-existent temp.txt file. Pick the file name wisely.

    The above is just a basic idea.
    Next step would be transforming this into "| more" using aliases or profile functions, etc.

    HTH, Marcelo Finkielsztein

提交回复
热议问题