title: Updating nuget package with and without prerelease flag in a C# project
body: <p>We are using git as source control and we follow the git flow workflow.</p>
  
  <p>We are using Visual Studio 2013</p>
  
  <p>We are using Teamcity v8.1</p>
  
  <p>We have 2 C# solutions. Solution A and solution B. Solution B uses a nuget package that solution A creates.</p>
  
  <p>We are using teamcity as a build server. We have 2 build configurations that creates the Project A nuget package. One build configuration creates a prerelease version of the nuget package, the other one creates the stable version of the nuget package. </p>
  
  <p>The build configuration for creating the prerelease nuget listens on the develop branch. The build configuration for the stable version listens on the master/release/hotfix branches</p>
  
  <p>When we work in the develop branch we use the prerelease version of the nuget package.
  But when we create a release branch we want to use the stable version of the nuget package. </p>
  
  <p>What we have tried so far is:
  In project B csproj file, we have added an  element in the BeforeBuild target that executes nuget.exe to update the prerelease version of the nuget package. That works well, since every time we build project B we will get the latest prerelease version of the nuget package.</p>
  
  <p>But when we are in the release/master/hotfix branch we don't want the prerelease version, we want the stable one.</p>
  
  <p>I've created a powershell script that is executed from project B csproj file in the BeforeBuild target</p>
  
  <p>In the powershell script I can find which git branch we are in, but I haven't found a way to update the nuget package to the latest stable version using nuget.exe. If I could use the nuget cmdlets in the powershell script I could run the update-package with the version flag, but that is not supportered when using nuget.exe</p>
  
  <p>Do you do something similar and how have you solved this?</p>