Equivalent of 'more' or 'less' command in Powershell?
Well... There is "more", which is more or less (...) the same you'd expect from other platforms. Try the following example:
dir -rec | more
Yes there is:
some-cmdlet | out-host -paging
The Powershell Community Extensions have a handy function named 'less' that provides a more complete Unix-style feature set, using a ported copy of less.exe to actually handle the paging.
You can install it by starting an admin shell and running:
Find-Package pscx | Install-Package -Force
(the force
is to upgrade older versions)
You can pipe strings to it, or give filenames as direct parameters.
type foo.txt | less
less foo.txt, bar.txt, baz.txt
It works in ConEmu and Powershell windows, but unfortunately it doesn't work the way you'd expect under the v2.0 ISE.
dir -rec | more
is bad advice.
It will cause powershell to evaluate the entire command prior to outputting it to the screen, something that is not needed for something like output paginating
In some extreme cases, it could cause the system to crash (e.g. dir 'C:\' | more
)
On the other hand, using out-host -paging
will output information to the screen as it is available.