public static async Task PumpOutput(this IProcessProxy proxy, Action <string> outputLine) { while (!proxy.HasExited) { if (await proxy.ReadLineAsync() is { } line) { outputLine(line); } } }
private async Task PumpOutputStream(IProcessProxy process) { while (!process.HasExited) { var line = await process.ReadLineAsync(); if (line != null) { Output.Add(line); } } }