Skip to content

-ContinueOnError does not work #295

@GreatTeacherBasshead

Description

@GreatTeacherBasshead

script.ps1:

Task Default -Depends T1

Task T1 -ContinueOnError {
    Write-Error "Task 1"
}

Expected Behavior

Error in task T1...
psake succeeded executing...

Current Behavior

Invoke-psake script.ps1:

Executing T1
----------------------------------------------------------------------
Error in task T1. task 1
----------------------------------------------------------------------
Error:
At C:\Program Files\WindowsPowerShell\Modules\psake\4.9.0\public\Assert.ps1:69 char:9 +
throw ('Assert: {0}' -f $failureMessage) +
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [<<==>>] Exception: Assert: Call stack was corrupt. Expected t1, but got default.

Invoke-psake psake.ps1 -taskList T1

Executing T1
----------------------------------------------------------------------
Error in task T1. task 1
----------------------------------------------------------------------
Error:
At C:\Program Files\WindowsPowerShell\Modules\psake\4.9.0\public\Invoke-psake.ps1:303 char:25 +
invoke-task $task +
~~~~~~~~~~~~~~~~~ [<<==>>] Exception: Exception calling "Pop" with "0" argument(s): "Stack empty." --> Stack empty.

Steps to Reproduce (for bugs)

Invoke script.ps1

Context

Upgrading psake from version 4.7.4 to 4.9.0. Works fine in 4.7.4.

Your Environment

  • Module version used: 4.9.0
  • Operating System: Win10/Win2016
  • PowerShell: 5.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions