How to avoid Pause due to long output

This topic contains 4 replies, has 2 voices, and was last updated by  Don Jones 11 months, 3 weeks ago.

  • Author
    Posts
  • #53113

    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. 
    
    • This topic was modified 11 months, 3 weeks ago by  nitheesh babu.
  • #53118

    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

    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

    nitheesh babu
    Participant

    Dan,

    I think I got it.

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

    qfarm /load /continue

  • #53124

    Don Jones
    Keymaster

    Perfect :).

You must be logged in to reply to this topic.