0

I was auditing all file content on users and is using the PowerShell command to get childitems but would like to see the options that will pause the results and wait for me to press any key to continue.

Get-Childitem -Recurse |

Iriza
  • 3
  • 1
  • Do you mean pause mid way through a `Get-ChildItem` or after it gathers the data? – Drew Feb 11 '20 at 04:06
  • 2
    There are some interesting answers here. Based on the thinking that piping Linux commands to `more` or `less` is what you're looking for: https://stackoverflow.com/questions/1078920/equivalent-of-more-or-less-command-in-powershell – mjsqu Feb 11 '20 at 04:07

1 Answers1

1

PowerShell Command Line

In PowerShell Command Line you can pipe your command through more or Out-Host -Paging

Get-ChildItem -Recurse | Out-Host -Paging

#Alias version
gci -rec | oh -Paging

Each page will show with the last line as:

<SPACE> next page; <CR> next line; Q quit

Allowing you to page through the output.

PowerShell ISE

This link gives more information, it seems like it is not possible in the scripting environment: Out-Host -Paging error "The method or operation is not implemented. " (ISE)

Community
  • 1
  • 1
mjsqu
  • 5,151
  • 1
  • 17
  • 21