Skip to content

Fix issue with Get-Process -Module failing to stop when piped to Select-Object#15682

Merged
rjmholt merged 1 commit intoPowerShell:masterfrom
ArmaanMcleod:get-process-module-fix
Aug 12, 2021
Merged

Fix issue with Get-Process -Module failing to stop when piped to Select-Object#15682
rjmholt merged 1 commit intoPowerShell:masterfrom
ArmaanMcleod:get-process-module-fix

Conversation

@ArmaanMcleod
Copy link
Copy Markdown
Contributor

@ArmaanMcleod ArmaanMcleod commented Jun 28, 2021

PR Summary

Previously when running Get-Process -Module and piping to Select-Object, you would receive this error:

getmodule-error

Where the command succeeds, but the upstream output is not halted and the Get-Process: Cannot enumerate the modules of the "pwsh" process. non-terminating error is included.

To fix this, I added another clause to catch PipelineStoppedException from WriteObject, and rethrow error, which omits the error message completely.

getmodule-error-fix

Also added a Pester test to verify this.

PR Context

Fix #15117

PR Checklist

@iSazonov iSazonov added the CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log label Jun 29, 2021
@ghost ghost added the Review - Needed The PR is being reviewed label Jul 6, 2021
@ghost
Copy link
Copy Markdown

ghost commented Jul 6, 2021

This pull request has been automatically marked as Review Needed because it has been there has not been any activity for 7 days.
Maintainer, please provide feedback and/or mark it as Waiting on Author

@rjmholt rjmholt assigned rjmholt and unassigned TravisEz13 Aug 12, 2021
@ghost ghost removed the Review - Needed The PR is being reviewed label Aug 12, 2021
@rjmholt rjmholt merged commit b70f06c into PowerShell:master Aug 12, 2021
@rjmholt
Copy link
Copy Markdown
Collaborator

rjmholt commented Aug 12, 2021

Thanks for your contribution @ArmaanMcleod!

@iSazonov iSazonov added this to the 7.2.0-preview.9 milestone Aug 12, 2021
@ArmaanMcleod ArmaanMcleod deleted the get-process-module-fix branch August 13, 2021 03:21
xtqqczze pushed a commit to xtqqczze/PowerShell-PowerShell that referenced this pull request Aug 20, 2021
@ghost
Copy link
Copy Markdown

ghost commented Aug 23, 2021

🎉v7.2.0-preview.9 has been released which incorporates this pull request.:tada:

Handy links:

@ghost
Copy link
Copy Markdown

ghost commented Sep 28, 2021

🎉v7.2.0-preview.10 has been released which incorporates this pull request.:tada:

Handy links:

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Get-Process -Module fails to stop when piped to Select-Object -First

5 participants