title: How to use powershell in tfs 2017
body: <p>I am trying understand how to really use PowerShell in TFS. I would like to add a release step to create a work item task, to tell our release management team they require to approve a release.</p>
  
  <p>Our company has many team projects and I want this to be available as a module that can be used by any project. The process I am using to use this is I am adding an artifact for the TFS project that we store our generic item.</p>
  
  <p>It is under <code>$\BuildSupport</code>, for this example, I create a build for my project under <code>$\WEB</code>. I am also creating the release Under <code>$\Web</code> as well. I create my new release definition, I add my Build artifact.</p>
  
  <p>I then add a Team foundation Version Control Artifact to <code>$\BuildSupport</code> Source alias is "BuildSupport".</p>
  
  <p>I then add a environment step called <em>TEST PRODUCTION</em> and add PowerShell task where the script path is: <code>$(System.DefaultWorkingDirectory)/BuildSupport/Main/BuildTools/TFSBuildScripts/CreateWorkItem.ps1</code></p>
  
  <p><strong>My issue is</strong> that when creating a new release it asks every time for me to choose the artifact version based the changeset for <code>BuildSupport</code>.</p>
  
  <p><a href="https://i.stack.imgur.com/pN2QW.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pN2QW.png" alt="Here is a screenshot of the error message"></a></p>
  
  <p>I don't want to have everyone do this every time is there a better way?</p>