title: Powershell StandardOutput buffer too small for external command
body: <p>Some useful info beforehand. What I'm attempting to do is read in output from an external command, specifically steamcmd, using powershell start-process and System.diagnostics.ProcessStartInfo.</p>
  
  <p>What I'm running into is RedirectStandardOutput buffer limit of 4096 bytes. The output I'm getting from the steamcmd is more than that buffer, so I'm only getting a portion of what I need. I have no other method for getting this data, other than calling steamcmd.</p>
  
  <p>You can see the output as well if you have steamcmd (it's free) and running this.</p>
  
  <pre><code>steamcmd +login anonymous +app_info_update 1 +app_info_print 443030 +quit
  </code></pre>
  
  <p>This will download all the manifest info about that appid.</p>
  
  <p>I've tried to redirect to a file and also to a variable, both work as expected, it's just that it's cut short by the buffer. There also doesn't appear to be a powershell method in System.Diagnostics.Process to wait for the OutputDataReceived event.</p>
  
  <p>Code used (stolen from another STackOverflow question)</p>
  
  <pre><code>$psi = New-object System.Diagnostics.ProcessStartInfo 
  $psi.CreateNoWindow = $true 
  $psi.UseShellExecute = $false 
  $psi.RedirectStandardOutput = $true 
  $psi.RedirectStandardError = $true 
  $psi.FileName = "C:\Path\to\SteamCMD.exe"
  $psi.Arguments = "+login anonymous +app_info_update 1 +app_info_print 443030 +quit"
  $process = New-Object System.Diagnostics.Process 
  $process.StartInfo = $psi 
  [void]$process.Start()
  $output = $process.StandardOutput.ReadToEnd()
  $process.WaitForExit() 
  $output
  </code></pre>
  
  <p>I think the actual issue is that steamCMD just outputs in one big write instead of line by line. I guess a better question would be, how can I increase the standardoutput buffer size of Start-Process or System.Diagnostics.Process.</p>
  
  <p>Note: running the steamcmd > somefile.txt results in same buffer limit.</p>