This topic contains 4 replies, has 2 voices, and was last updated by
September 1, 2016 at 9:01 pm #53113
This might have been asked many times but I couldnt find the thread.
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.
September 1, 2016 at 9:05 pm #53118KeymasterTopics: 13Replies: 4872Points: 1,811Rank: Community Hero
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?
September 1, 2016 at 9:21 pm #53120
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.
September 1, 2016 at 9:27 pm #53122
I think I got it.
The command itself have a switch to avoid the page break.
qfarm /load /continue
September 1, 2016 at 9:35 pm #53124KeymasterTopics: 13Replies: 4872Points: 1,811Rank: Community Hero
The topic ‘How to avoid Pause due to long output’ is closed to new replies.