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:
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:
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
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:
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
logincommand with a switch like--ensure(open to other suggestions), which you'd use like: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.