title: Running Powershell from C# gives error: `running scripts is disabled on this system`
body: <p>In my C# application, I try to create a <code>RunSpace</code> to invoke some Powershell scripts. However when it reaches the code to actually create it, it fails with the error below:</p>
  
  <pre><code>var implementedHost = new implementedPSHost();
  using (var rs = RunspaceFactory.CreateRunspace(customPSHost))
  {
  </code></pre>
  
  <p><code>cannot be loaded because running scripts is disabled on this system. For more information, see about_Execution_Policies at https://go.microsoft.com/fwlink/?LinkID=135170.At line:1 char:3+ . .\Scripts\loadFunctions.ps1+</code></p>
  
  <p>As suggested elsewhere, I ran a Powershell window and executed <code>Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy Unrestricted</code> but this did not help. The error still happens. Does anyone have any ideas how to fix this?</p>