Home Dashboard Directory Help
Search

PowerShell 3 bug with stack trace by Michael Naumov


Status: 

Active


4
0
Sign in
to vote
Type: Bug
ID: 773611
Opened: 12/5/2012 5:48:57 PM
Access Restriction: Public
1
Workaround(s)
view
1
User(s) can reproduce this bug

Description

If we run the following script in PowerShell 3, we will see a wrong stacktrace

===
[CmdletBinding()]
param
(
)

$script:ErrorActionPreference = "Stop"

$null.ToString()
===
Details
Sign in to post a comment.
Sign in to post a workaround.
Posted by Michael Naumov on 12/6/2012 at 1:16 AM
The following line is a workaround which works in both PowerShell 2 & 3

Trap { throw $_ }

Insert it in the top of your script