Adding a conditional check to account for script blocks in PSObject when using ForEach-Object -Parallel by ryneandal · Pull Request #17234 · PowerShell/PowerShell · GitHub
Skip to content

Adding a conditional check to account for script blocks in PSObject when using ForEach-Object -Parallel#17234

Merged
daxian-dbw merged 1 commit intoPowerShell:masterfrom
ryneandal:bugfix-17152
May 4, 2022
Merged

Adding a conditional check to account for script blocks in PSObject when using ForEach-Object -Parallel#17234
daxian-dbw merged 1 commit intoPowerShell:masterfrom
ryneandal:bugfix-17152

Conversation

@ryneandal
Copy link
Copy Markdown
Contributor

Added a check to ensure exceptions are thrown if passing a script block within PSObject to ForEach-Object -Parallel.

PR Summary

Updates the conditional statement that throws ParallelUsingVariableCannotBeScriptBlock for Script Blocks in a PSObject.

PR Context

Prevents circumvention of conditional check when Script Block is wrapped in a PSObject.

Closes #17152

PR Checklist

Added a check to ensure exceptions are thrown if passing a script block within PSObject to ForEach-Object -Parallel.
@pull-request-quantifier-deprecated
Copy link
Copy Markdown

@ghost
Copy link
Copy Markdown

ghost commented Apr 29, 2022

CLA assistant check
All CLA requirements met.

Copy link
Copy Markdown
Member

@daxian-dbw daxian-dbw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@daxian-dbw daxian-dbw added the CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log label May 2, 2022
@daxian-dbw daxian-dbw merged commit 2550a3a into PowerShell:master May 4, 2022
@ghost
Copy link
Copy Markdown

ghost commented May 23, 2022

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log Extra Small

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PSObject wrapped ScriptBlocks should also throw when attempting $using: access

3 participants