Search code examples
powershellget-childitem

PowerShell command pipe line that will pause during get-Childitem -Recurse


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 |


Solution

  • 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)