title: Extract branch name in MSBuild prebuild step
body: <p>My ultimate goal here is to extract the branch name (which is part of $SolutionDirectory) in an MSBuild pre-build event and then inject it into my app.config appSettings.</p>
  
  <p>I've been doing lots of digging and haven't really found an approach to this problem.</p>
  
  <p>I would like to be able to do something like this during pre-build:</p>
  
  <pre><code>&lt;XmlPoke XmlInputPath="App.config" 
    Query="/configuration/appSettings/add[@key='BuildBranch']/@value" 
    Value="$(Branch)" /&gt;
  </code></pre>
  
  <p>Has anyone done something like this before?</p>