Closed JustinGrote closed 3 years ago
Warning, Verbose, Debug data streams are currently written directly to the host, so they are currently not redirectable. This is to allow extension vaults to directly prompt the user (via cmdlet/host calls). I don't think there is any way to stream back to the calling cmdlet without causing duplicate messages to be displayed. But I'll look into it.
Ok, I think I have a fix for this and will include it in the next release.
Fixed in preview2.
@PaulHigin sorry for the late closing of the circle on this, yes it worked for me except for 1 test but I think I can work around that. Thanks!
In SecretManagement.KeePass, this test fails:
because previously with the same-runspace nested module I could capture the warning stream and test it. Now it appears the warning stream gets emitted separately and thus is uncapturable not just by my test but by a normal user, so they cannot suppress or otherwise redirect warning streams as they would expect.
SecretManagement should capture the streams from the runspace and emit them as part of the original command call so they can be acted upon appropriatley.