Skip to content

Enhancement: add output value none to disable any output #4804

@martinlingstuyl

Description

@martinlingstuyl

Context

In #4692 we added a config key to disable the spinner. This is useful (among other things) because of limitations with the PowerShell error stream in Azure Functions.

We can now just disable the spinner using m365 cli config set --key showSpinner --value false

However: the command m365 cli config set --key showSpinner --value false itself also triggers the spinner.

We can work around that by piping the error stream away using

m365 cli config set --key showSpinner --value false 2>$null

But it would be better if we implement an easier route.

Solution

Add none to the available values of the global output option. Specifying this value will force the CLI to not write anything to any output stream. (Be it stderr or stdout)

It can then be used (among other things) when running the config set command to block the spinner from showing up.

m365 cli config set --key showSpinner --value false --output none

Implementation

The Cli runtime logs using the Cli.log and Cli.error methods. These should in all places be ignored if output=none.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions