title: How to debug Push-AppveyorArtifact when it fails
body: <p>As part of my CI running on AppVeyor I'm uploading a log from the installer using <code>Push-AppveyorArtifact</code>. While most of the time it works perfectly for a single PR the upload fails with the following output:</p>
  <pre><code>Push-AppveyorArtifactInternal : Error uploading artifact to the storage: One or more         errors occurred.
  At C:\Program Files\AppVeyor\BuildAgent\Modules\build-worker-api\build-worker-    api.psm1:209 char:2
      +     Push-AppveyorArtifactInternal -FullPath $fullPath -FileName $File ...
      +     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      + CategoryInfo          : NotSpecified: (:) [Push-AppveyorArtifactInternal],     Exception
      + FullyQualifiedErrorId :     System.Exception,Appveyor.BuildAgent.Api.Utils.PushAppveyorArtifactInternalCmdlet
      Command executed with exception: Error uploading artifact to the storage: One or more errors occurred.
  </code></pre>
  <p>Given this output is not very informative  I am at a loss and have no idea how this can be debugged further. List of things I've tried:</p>
  <ul>
  <li>Contacted AppVeyort support - no reply for over a month</li>
  <li>Made sure that the file I am trying to upload exists and is not empty</li>
  <li>Since as part of the problematic pull request the process which creates this file fails to exit properly I've tried killing it manually, confirmed that it is no longer active and retied the upload - same error.</li>
  <li>Tried increasing the verbosity of <code>Push-AppveyorArtifact</code> by providing <code>-Verbose -Debug</code> which appears to be the highest verbosity level possible but no more info shows up.</li>
  </ul>
  <p>It looks like the following sequence causes the upload to fail:</p>
  <ul>
  <li>The process which creates a log file which fails to upload later on is started and then we're waiting for it to finish with <code>wait-process</code> for 3 minutes</li>
  <li>If it finishes in the specified time the log file created it creates is uploaded successfully</li>
  <li>Since we want to know if the process exited or not we need to specify <code>-ErrorAction Stop</code> for the <code>wait-process</code> invocation.</li>
  <li>If <code>wait-process</code> raises an exception i.e. process is still running the <code>Push-AppveyorArtifact</code> fails with the error shown above</li>
  </ul>