title: How to capture console app output in Octopus custom PowerShell script?
body: <p>I simply created an console app with argument number check at the very beginning. And after the package is deployed, in the deployment PowerShell script part, I directly call this app with no argument to test the script. It seems Octopus just captures the exit code and show there is no output from the app captured in task log at all.</p>
  
  <pre><code>    static void Main(string[] args)
      {
          if (args.Length &lt; 4)
          {
              Console.WriteLine("Invalid argument number");
              Environment.ExitCode = -1;
              return;
          }
      }
  </code></pre>
  
  <p>However, if I simply put "echo 'test'" or even just 'test' string in the script, the output was captured in Octopus deployment task log. Any idea what is the correct way to log console app in the script? Thanks.</p>