Hi,
I'm using PowerShell v1.0 (It is a requirement that I cannot use 2.0) and am having trouble trying to programatically capture the cmdlet output in the Warning stream.
In Powershell 2.0 it's easy:
var powerShell = PowerShell.Create();
powerShell.AddCommand(someCommand);
powerShell.Invoke();
foreach (var warning in powerShell.Streams.Warning) { ... }
However, the System.Management.Automation.PowerShell class doesn't exist in PowerShell version 1, and the classes that do exist don't seem to give access to the warning stream. In addition, the warning stream information does not sit in the standard output from the cmdlet.
Thanks! Sam