title: How to run PowerShell script in C# from relative path?
body: <p>I'm trying to run a PowerShell script from my C# application.  I know how to do so with an absolute path:</p>
  
  <pre><code>    using (PowerShell pshell = PowerShell.Create())
      {
          pshell.AddScript( @"C:\Path\To\Webapp\psScript.ps1" );
          pshell.Invoke();
      }
  </code></pre>
  
  <p>What I don't know how to do is use a relative path.  My <code>psScript.ps1</code> is located in the same directory as my Visual Studio project, and I'd like to use a relative path (such as <code>./psScript.ps1</code>), so that when I publish/export my project to different computers, the path to the script doesn't become invalidated</p>
  
  <p>Sooo, how do I use a relative path in the PowerShell.AddScript() method?  Any help would be appreciated!</p>
  
  <p>I looked here but this doesn't answer my question: 
  <a href="https://stackoverflow.com/questions/4724290/powershell-run-command-from-scripts-directory">PowerShell: Run command from script&#39;s directory</a></p>