I think the problem is a little harder then we all thought - if you look at the output of the psake error log file you will notice that even though you get more information - the exact line and column position of the error in the build script isn't correct - that's because psake is dot-sourcing the build file and not parsing it - so that means the error line is actually the line in the psake module where the error was detected - it will always be the line number for the Assert() function which is by psake to test for and throw errors.
Below is an example of the error log file when I ran: Invoke-psake .\specs\default_task_with_action_should_fail.ps1
Notice the ScriptLineNumber has a value of 399 - that's the line number in the psake.psml not the line number in .\specs\default_task_with_action_should_fail.ps1
This may be a tough nut to crack.
----------------------------------------------------------------------
5/31/2010 2:26:35 PM: An Error Occurred. See Error Details Below:
----------------------------------------------------------------------
ErrorRecord
PSMessageDetails :
Exception : System.Management.Automation.RuntimeException: Error: 'default' task cannot specify an action
TargetObject : Error: 'default' task cannot specify an action
CategoryInfo : OperationStopped: (Error: 'default...ecify an action:String) [], RuntimeException
FullyQualifiedErrorId : Error: 'default' task cannot specify an action
ErrorDetails :
InvocationInfo : System.Management.Automation.InvocationInfo
PipelineIterationInfo : {}
ErrorRecord.InvocationInfo
MyCommand :
BoundParameters : {}
UnboundArguments : {}
ScriptLineNumber : 399
OffsetInLine : 10
HistoryId : 183
ScriptName : C:\Users\Jorge\Documents\Projects\psake\psake.psm1
Line : throw $failureMessage
PositionMessage :
At C:\Users\Joge\Documents\Projects\psake\psake.psm1:399 char:10
+ throw <<<< $failureMessage
InvocationName : throw
PipelineLength : 0
PipelinePosition : 0
ExpectingInput : False
CommandOrigin : Internal
Exception
0000000000000000000000000000000000000000000000000000000000000000000000
ErrorRecord : Error: 'default' task cannot specify an action
StackTrace :
WasThrownFromThrowStatement : True
Message : Error: 'default' task cannot specify an action
Data : {}
InnerException :
TargetSite :
HelpLink :
Source :