title: PowerShell Invoke-Sqlcmd switches into sqlps session
body: <p>I am writing a script in PowerShell ISE and I am using Invoke-Sqlcmd.
  After the command is executed the Powershell session switches into sqlps session (PS SQLSERVER:>) and I can't execute script for the second time. I have to quit PowerShell ISE and start it again.</p>
  
  <p>So my question is: how to switch back from sqlps to regular ps or how to prevent Invoke-Sqlcmd from switching session.</p>
  
  <pre><code>Invoke-Sqlcmd -ServerInstance $server -Database master -Username $user -Password $password   -InputFile $file `
     -ErrorAction Stop -OutputSqlErrors $true -Variable $variable
  </code></pre>
  
  <p>This doesn't work:</p>
  
  <pre><code>Push-Location
  Invoke-Sqlcmd -ServerInstance $server -Database master -Username $user -Password $password   -InputFile $file `
  -ErrorAction Stop -OutputSqlErrors $true -Variable $variable
  Pop-Location
  </code></pre>