10000 Get-Process -Module fails to stop when piped to Select-Object -First · Issue #15117 · PowerShell/PowerShell · GitHub
[go: up one dir, main page]

Skip to content
Get-Process -Module fails to stop when piped to Select-Object -First #15117
@mklement0

Description

@mklement0

It seems that when Select-Object -First tries to stop upstream pipeline input, Get-Process -Module doesn't handle this request properly and emits many spurious error messages.

Steps to reproduce

Get-Process -Module  -Id $PID -ev errs | Select-Object -First 1 
$errs.Count | Should -Be 0

Expected behavior

No errors should occur, and the test should succeed.

Actual behavior

Error message Get-Process: Cannot enumerate the modules of the "pwsh" process. is (wrongly) emitted (without Select-Object -First, the command succeeds), and the test fails:

InvalidResult: Expected 0, but got 1.

Environment data

PowerShell Core 7.2.0-preview.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-BugIssue has been identified as a bug in the productResolution-FixedThe issue is fixed.Up-for-GrabsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorsWG-Cmdlets-Managementcmdlets in the Microsoft.PowerShell.Management module

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0