What is the powershell equivalent of 'less'?
I see 'more', but it lacks some of the features I rely on (e.g. searching through the file)
I seek a pager (equivalent of 'less') which allows searching (match or ignore case), multiple files at once, etc.
Some of our servers run windows 2008 and I lack admin privileges to install cygwin
I had heard windows 2008, MSFT got their act together and provided some easy-for-admins tools.
Update:
I should give some context:
thanks
PowerShell logs can be viewed using the Windows Event Viewer. The event log is located in the Application and Services Logs group and is named PowerShellCore .
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.
Viewing the Windows PowerShell Event Log To examine the events and their properties, use the Sort-Object cmdlet, the Group-Object cmdlet, and the cmdlets that contain the Format verb (the Format cmdlets). For more information, type "Get-Help Get-EventLog" and "Get-Help Get-WmiObject".
The Get-Content cmdlet uses the Path parameter to specify the LineNumbers. txt file and displays the content in the PowerShell console.
It reads like you know you can do this:
gc logfile.log | more
(GC is an alias for Get-Content).
You may be able to do the filtering etc.. with this more information can be found by running these commands:
Get-Help Get-Content Get-Help
Get-Content -Examples
(Get-Help gc would work fine as well).
And the bits you may be interested in are limit\filter etc...
Get-Help gc -Parameter * | more
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With