title: How to resolve Nuget Package Version and Path in Pre-Build Event of a Project?
body: <p>I have a NuGet Package containing content files that is referenced in my project.  When getting latest on a new machine, the build fails because NuGet Restore doesn't copy content files.  So what I want to do is this:</p>
  
  <pre><code>In PreBuild
  If my Content file doesn't exist,
      run this nuget Command: "Update-Package My.Nuget.Sources -reinstall"
  </code></pre>
  
  <p>I'm struggling with determining path differences due to versioning of the Nuget files and getting access to nuget.  How do I actually generate the <code>SourceOnlyNugetVersion</code> and <code>NugetPath</code> variables below?</p>
  
  <pre><code>if not exist "$(ProjectFolder)App_Packages\My.NuGet.Sources.$(SourceOnlyNugetVersion?)\somefile.cs" (
      "$(NugetPath)nuget.exe" Update-Package My.NuGet.Sources -reinstall        
  ) 
  </code></pre>