PoshCode Logo PowerShell Code Repository

Set-PsBreakPointLastErro by Lee Holmes 17 months ago
embed code: <script type="text/javascript" src="http://PoshCode.org/embed/2221"></script>download | new post

From Windows PowerShell Cookbook (O’Reilly) by Lee Holmes

  1. Set-StrictMode -Version Latest
  2.  
  3. $lastError = $error[0]
  4. Set-PsBreakpoint $lastError.InvocationInfo.ScriptName `
  5.     $lastError.InvocationInfo.ScriptLineNumber

Submit a correction or amendment below (
click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Syntax highlighting:


Remember me