How to avoid Pause due to long output

This topic contains 4 replies, has 2 voices, and was last updated by Profile photo of Don Jones Don Jones 4 weeks, 1 day ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #53113
    Profile photo of nitheesh babu
    nitheesh babu
    Participant

    Hi,

    This might have been asked many times but I couldnt find the thread.

    Issues:
    If a command is having a very long output powershell simply hangs. Is there a bypass which I can use to avoid it during automation?

    qfarm /load | out-file .\citrixload.txt
    #above is a citrix related command that gives me the entire list of servers and corresponding loads in my citrix farm, it can have 1000 plus line output. 
    #I need this result as a whole, unattended to be supplied to other functions for automation.
    #But due to the length of the result, powershell simply hangs. 
    
    #53118
    Profile photo of Don Jones
    Don Jones
    Keymaster

    No, not easily. In this case, PowerShell is running Cmd.exe to run qfarm, so PowerShell isn't really in control.

    Have you considered running "qfarm > output.txt" in a batch file or something first, to get the output into a file that PowerShell can simply load?

    How large is the output – e.g., if you output it to a file, how large is the file?

    #53120
    Profile photo of nitheesh babu
    nitheesh babu
    Participant

    Thanks Don.

    In my case it is a 350 line output. Powershell stops at 300 Lines.

    Even CMD stops at 300 lines.

    if I do qfarm /load > c:\output.txt in CMD, it is getting hung. I have to CTRL+c to exit.

    It only works if I run 'qfarm /load' in CMD. Then it shows the 'Press any key when ready..." and continues if i press Enter.

    #53122
    Profile photo of nitheesh babu
    nitheesh babu
    Participant

    Dan,

    I think I got it.

    The command itself have a switch to avoid the page break.

    qfarm /load /continue

    #53124
    Profile photo of Don Jones
    Don Jones
    Keymaster

    Perfect :).

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.