Enable users to stop pipeline/making StopUpstreamCommandsException public
Votes from Connect: 24
Original Date Submitted: 10/25/2012 1:54:42 PM
Site Name: PowerShell
Feedback ID: 768650
Frequency: Always Happens
Regression: No, this is new to the most recent version
In PSv3, the pipeline can be stopped. Select-Object supports this with its -First parameter by raising a (non-public) StopUpstreamCommandsException exception.
It is of great value to be able to stop the pipeline if your mission is completed before the emitting cmdlet has provided all results.
In fact, the PS pipeline would gain a completely new "feature". Currently, it is a memory throttle and provides realtime feedback at the cost of performance. If stopping the pipeline was something available to users, it could also be a generic means of running cmdlets only partially.
Select-Object is a great start but you do not always know beforehand how many elements you need. So it would be beneficial to have a Stop-Pipeline cmdlet or at least a public StopUpstreamCommandsException that a script programme can throw.
Product Studio item created by Connect Synchronizer due to creation of feedback ID 768650 (http://connect.microsoft.com/PowerShell/feedback/ViewFeedback.aspx?FeedbackID=768650).
Internal BugId: 3902
Ilya Sazonov commented