The .NET System.Diagnostics.Process API is a bit of a low-level API with some inconvenience. In some cases the control may be useful, in many other cases, it is tedious and unproductive to use. As a thought experiment, I decided to try to model the process API from the point of view of a stream of events (of different kinds), in particular as an observable stream of events (i.e. System.IObservable).
The new API can be called like this (in this case using LINQPad’s Dump extension method for demonstration purposes):
It also supports running script files now.
The full source code is located at this Github repository: