Create TFS work item with PowerShell
<p>I'm working on a TFS build with a pre-build PowerShell script that (in addition to building my app) automatically checks out a file where we maintain version, increments the build number, then checks the file in.</p>

<p>I have been able to do this, except that I get an error from the script which results in a partially successful build (orange).  I need to have a fully successful (green) build.</p>

<p>Here's the check-in line (using <a href="https://visualstudiogallery.msdn.microsoft.com/f017b10c-02b4-4d6d-9845-58a06545627f" rel="nofollow">TFS Power Tools for VS 2013</a>):</p>

<pre><code>New-TfsChangeset -Item $versionFile -Override "Automated" -Notes "Code Reviewer=tfs" -Comment "Automated"
</code></pre>

<p>The error I receive is that the changeset is not associated with a work item, but the <code>-Override</code> should handle that.  The funny thing is that it checks in anyway.</p>

<p>Running locally on my machine instead of the build server, I get the same thing, except that I also see a line that says <code>The policies have been overridden.</code>  This tells me that the override <em>is</em> working, but it still outputs the error.</p>

<p>I've tried adding <code>-ErrorAction SilentlyContinue</code>, but it has no effect.</p>

<p>I need one of three options:</p>

<ol>
<li>A way to suppress output of the checkin error,</li>
<li>A way to create a work item and associate it to the checkin, or</li>
<li>Some other third option that will result in a green build.</li>
</ol>

<p>Any ideas?</p>