title: How can I do a nuget restore using the built-in PackageManagement provider for NuGet?
body: <p>(I have a strong feeling there's something fundamental that I'm not understanding here, so please bear with me...)</p>
  
  <p>I have a Local NuGet package feed on a network share that has some packages on it, and I have a User <code>NuGet.Config</code> file that points to that network share as a package source. Inside a project folder (git repository), I have a <code>packages.config</code> file that references a package from this local feed by name. I want to restore this package into this project folder.</p>
  
  <p>What makes this difficult, I think, is that this is not a Visual Studio project. I work with it in a regular text editor, and have some PowerShell build scripts.</p>
  
  <p>I know I can just download the nuget.exe binary and put it in my path or working directory and then do a <code>nuget restore</code> from the command line, but the problem I'm trying to solve here is rather one of philosophical purity. Namely:</p>
  
  <ul>
  <li>My repository should be portable, with a minimum of prerequisite dependencies</li>
  <li>My repository must not contain extraneous binaries or code that it does not own</li>
  </ul>
  
  <p>Therefore, I can't commit the <code>nuget.exe</code> binary to my repository to make it portable; instead, I want to rely on a prerequisite dependency of "modern Windows  10 environment", which provides me with PowerShell and the built-in PackageManagement tools which come with the ability to bootstrap various providers including PowerShellGet and NuGet.</p>
  
  <p>This <em>feels like</em> the right path, since PackageManagement is designed to be a built-in, unified interface to any package management solution. (But am I misunderstanding this, and it's actually only meant to be for installing software to your operating system or user account? I'm unable to find anything that clearly delineates this.)</p>
  
  <p>So, is it possible to leverage built-in PackageManagement to do a <code>nuget restore</code> (or equivalent) from a <code>packages.config</code> file, outside the scope of Visual Studio? Or if not directly, is there an obvious/simple solution to bootstrapping up from PackageManagement to something that can accomplish this kind of restore?</p>