Skip to content

fix(scoop-hold): Use 'foreach' loop to allow 'continue' statement#6078

Merged
niheaven merged 2 commits intodevelopfrom
fix-hold
Jul 25, 2024
Merged

fix(scoop-hold): Use 'foreach' loop to allow 'continue' statement#6078
niheaven merged 2 commits intodevelopfrom
fix-hold

Conversation

@niheaven
Copy link
Copy Markdown
Member

@niheaven niheaven commented Jul 25, 2024

Description

continue statement shouldn't be used outside of a loop, switch, or trap.

Using continue inside a pipeline, such as a ForEach-Object script block, not only exits the pipeline, it potentially terminates the entire runspace.

Ref: https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_continue?view=powershell-7.4#do-not-use-continue-outside-of-a-loop-switch-or-trap

Motivation and Context

How Has This Been Tested?

Checklist:

  • I have read the Contributing Guide.
  • I have ensured that I am targeting the develop branch.
  • I have updated the documentation accordingly.
  • I have updated the tests accordingly.
  • I have added an entry in the CHANGELOG.

@niheaven niheaven merged commit 49ee8ad into develop Jul 25, 2024
@niheaven niheaven deleted the fix-hold branch July 25, 2024 05:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant