title: Using PsExec with spawning a child process results in truncated stdout
body: <p>My goal is to be able to execute a command on a remote machine and get the full stdout response from the command that was run. What I am getting is a truncated result. When I run the same command through command prompt, I get the full output from the command run. Here is my code:</p>
  
  <pre><code>    var process    = spawn('PsExec.exe', ['\\\\servername', 'ipconfig']);
      var doOnce = true;
      process.stdout.on('data', function (data) {
          log.info('stdout: ' + data.toString());
          if(doOnce){
              doOnce = false;
              process.stdin.write('ipconfig');}
      });
  
      process.stderr.on('data', function (data) {
          log.info('stderr: ' + data.toString());
      });
  
      process.on('exit', function (code) {
          log.info('child process exited with code ' + code);
      });
  </code></pre>
  
  <p>When executed I get the following console output. As you can tell, all of ipconfig has been truncated. If I do another command such as netstat, I get most of the results before truncating occurs, so I don't believe this has anything to do with the buffer. I really am just out of ideas at this point.</p>
  
  <pre><code>info: stderr: 
  PsExec v2.11 - Execute processes remotely
  Copyright (C) 2001-2014 Mark Russinovich
  Sysinternals - www.sysinternals.com
  
  
  info: stdout: 
  Windows IP Configuration
  
  
  
  ipconfig exited on servername with error code 0.
  
  info: child process exited with code 0
  </code></pre>