title: Adjust PSModulePath via Runspace in .Net code
body: <p>I'm attempting to setup an environment before running some scripts.  This environment is made up of two parts.</p>
  
  <ul>
  <li>a few modules I want to load beforehand</li>
  <li>a directory full of specific modules that are loadable with a simple 'Import-Module '</li>
  </ul>
  
  <p>I'm ok specifiying the absolute path for the modules that are being 'pre-loaded'.</p>
  
  <p>I'm creating an InitialSessionState object and calling the ImportPSModule and that aspect is working just fine.  Where I'm struggling is getting the module loading path set up.  My goal isn't to <em>replace</em> that variable, but to add to it.</p>
  
  <p>I attempted to open the runspace, adjust the env:PSModulePath via the runspace.SessionStateProxy.GetVariable and runspace.SessionStateProxy.SetVariable.  The problem is this requires me to open the runspace.  If I attempt to close it after I'm done I get exceptions when I try to re-open it.  I can leave it open, but I'd prefer not to at that point in my code.</p>
  
  <p>Is there any way for me to manipulate the module loading path without opening up the runspace and setting the variable there?</p>