Merged
Conversation
The current task is popped from the call stack at the end of the function. When the task fails and -ContinueOnError is specified, the catch block unnecessarily pops the task from the call stack at this point. This causes the pop at the end of the function to actually pop the parent task from the stack.
This is to resolve a specific scenario where a task with -ContinueOnError depends on a task which fails. The task which fails never pops itself from the stack (it fails before it gets to that point), then the task which depends on in attempts to pop itself from the stack, but actually pops the failed task, which results in a validation error. To fix this, I've added a try block immediately after the task is pushed onto the stack, and put the code which pops it into a finally block.
Member
|
Thanks for fixing this @UberDoodles! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Related Issue
#295
Motivation and Context
As described in the issue, this is an issue which has broken a feature which previously worked.
How Has This Been Tested?
Created a new Pester test, and ran all existing tests locally.
Tested on Windows 10, Powershell 5.1.
Screenshots (if appropriate):
Types of changes
Checklist: