title: Debug powershell in Visual studio code with parameters from command line
body: <p>Using Powershell ISE I often set breakpoints in a script and start the script from command line. ISE then stops at the breakpoint and lets me debug from there. How do I do the same from Terminal in Visual Studio Code? Below is a script just to show you what I mean. Starting from a terminal I would write:</p>
  <pre><code>.\hello.ps1 -firstName &quot;firstName&quot; -lastName &quot;theLastName&quot;
  </code></pre>
  <p>But doing that from terminal it just starts a new window.</p>
  <pre class="lang-ps prettyprint-override"><code>param(
  [string]$firstName,
  [string]$lastName
  )
  
  Write-Host &quot;Starting test script&quot;
  try
  {
     Write-Host &quot;Hello $firstName $lastName&quot;        
  }
  catch
  {
      Write-Error &quot;Error. Exception: $_&quot;
  }
  
  write-host &quot;Script done&quot;
  </code></pre>