When I run "git add . --verbose" I get messages showing the files that are being added like this:
add 'file1.txt"
add 'file2.txt"
But when I run the same git command in C# via PowerShellInstance.BeginInvoke(), the verbose messages are not being redirected to Streams.Verbose. In fact, they are not being redirected to any of the Streams. What am I missing? Is there anything wrong with the code?
Here's my code:
var ps = PowerShell.Create();
ps.Streams.Verbose.DataAdded += VerboseStream_DataAdded;
ps.BeginInvoke<PSObject, PSObject>(null, output);
void VerboseStream_DataAdded(object sender, DataAddedEventArgs e)
{
// this is never called
}