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
It seems that when
Select-Object -Firsttries to stop upstream pipeline input,Get-Process -Moduledoesn't handle this request properly and emits many spurious error messages.Steps to reproduce
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 (withoutSelect-Object -First, the command succeeds), and the test fails:Environment data