Skip to content

Simplify ensuring that the user is signed in in a script #5217

@waldekmastykarz

Description

@waldekmastykarz

When building scripts using the CLI, typically you first want to ensure that the user is signed in. In PowerShell, you'd do something similar to:

image

This seems like an unnecessary complexity that we should handle in the CLI and don't offload it on the user.

What if we'd extend the login command with a switch like --ensure (open to other suggestions), which you'd use like:

m365 login --ensure

If the user is already signed in, the command doesn't do anything. If the user isn't signed in, it will start the login flow considering all other login args passed, eg.

m365 login --ensure --authType browser

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions