/// <summary>
/// Read the output until we see a particular line.
/// </summary>
/// <param name="_stream"></param>
/// <param name="p"></param>
private void DumpTillFind(ShellStream stream, string matchText, Action<string> ongo = null)
{
while (true)
{
var l = stream.ReadLine();
if (l == null)
{
Thread.Sleep(100);
}
else
{
if (l.Contains(matchText))
{
return;
}
else
{
if (ongo != null)
{
ongo(l);
}
}
}
}
}