title: Running powershell scripts from Python without reimporting modules on every run
body: <p>I am creating a Python script that calls a Powershell script <code>script.ps1</code> that needs to import the Active-Directory module.  However, every time I run the powershell script using 
  <code>check_output('powershell.exe -File script.ps1')</code>
  it needs to re-import the active directory module for each run of script.ps1, which makes the run time take about 3 seconds longer then it needs to.  </p>
  
  <p>I was wondering then, if there was a way to keep the Powershell module imported (as if it were being ran directly from Powershell, and not from Python) so that I can use things like</p>
  
  <pre><code>if(-not(Get-Module -name ActiveDirectory)){
    Import-Module ActiveDirectory
  }
  </code></pre>
  
  <p>to speed up execution time.</p>