3

I execute this Powershell command:

Get-Process | Out-Host -Paging

But it returns me error:

ut-lineoutput : The method or operation is not implemented. At line:1 char:1 + Get-Process | Out-Host -Paging + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [out-lineoutput], NotImplementedException + FullyQualifiedErrorId : System.NotImplementedException,Microsoft.PowerShell.Commands.OutLineOutputCommand

I have checked help for Out-host and with paging it should be returnig results page by page.

Basically I want to see results page by page not everythign flush. Please help

js2010
  • 23,033
  • 6
  • 64
  • 66
user576510
  • 5,777
  • 20
  • 81
  • 144

2 Answers2

4

The -Paging flag doesn't work for powershell_ise.exe.

Use powershell.exe

Another option though it may not be exactly what you need...

$file="c:\temp\out.txt"
dir -Recurse | Out-File $file
notepad $file
Maximilian Burszley
  • 18,243
  • 4
  • 34
  • 63
Ambrose Leung
  • 3,704
  • 2
  • 25
  • 36
0

to paginate, you could do this...

$page = 20
$step = $page
$command = get-process
$count = $command.count
while ($count -gt ($page - $step)){
    $command[($page - $step)..$page]
    Pause
    $page += $step + 1
}

Just set $page to whatever you want to see per page ... it's actually 1 more than you'd like because you start with 0 NOT 1. so 20 will show 21 per page.

some one turned this into a module, so you could do that... http://community.idera.com/powershell/powertips/b/tips/posts/using-more-in-the-powershell-ise

his script basically reads each line individually, then if you hit your counter, it just spits out "press enter to continue" then reads the next line etc...

Robert Cotterman
  • 2,213
  • 2
  • 10
  • 19