Chirishman/PuppyFriendlySpeculationControl

Still has output when $VerbosePreference = SilentlyContinue

Closed this issue · 5 comments

The "-Verbose" switch on line 138 and 141 of version 1.5.2.1 mean that this still emits text when setting $VerbosePreference = SilentlyContinue.

See here: The "-Verbose" switch on line 138 and 141 of version 1.5.2.1 mean that this still emits text when setting $VerbosePreference = SilentlyContinue.

Since I run pester tests and capture the stdio (because I am running via AWS SSM which captures stdio to bucket) - this messes up the XML output with this additional output.

Could you please remove these switches and leave the verbosity completely up to the caller so it can be used in automation?

Since I run pester tests and capture the stdio (because I am running via AWS SSM which captures stdio to bucket) - this messes up the XML output with this additional output.

Could you please remove these switches and leave the verbosity completely up to the caller so it can be used in automation?

Let me know if there is another way to get it to be completely silent.

The thought with those explicit flags was to somewhat match the logic of the original, which will always display those lines if they have contents. I want to try to maintain as close to the expected behavior as possible while also fixing the problems that I see with the original script.

This part in particular I see as being targeted at the subset of users who may want to use the tool but are not versed in PowerShell. Having this on by default even without a -verbose flag therefore is somewhat necessary so that any user of the tool, no matter how poorly versed in PowerShell, will at least be shown the minimum necessary information to act.

If you stick the output of the function into a variable or pipe it somewhere the verbose text won't come along with. My thinking is that you should just be capturing the actual output object returned by line 66.

Maybe I'm not understanding. Can you give me an example of why you would be capturing the raw console output instead of capturing the output object?

I would love to do that, BUT when you submit code to be run by AWS SSM, all you can do is collect stdout to an S3 object.

So my automation remotely submits the pester test along with an S3 Bucket to collect stdout.

This keeps my Windows build automation very simple as there is no need to configure and deconfigure machine to machine level access between the CI system running the test and the instance being testing.

If you don't wish to fully support verbose, then I feel there should be a "-Silent" switch that nixes all messaging output.

Feature added and published to gallery as 1.5.2.2

Awesome - thanks!