$lists = m365 todo list list -o json | ConvertFrom-Json
m365 cli config set --key printErrorsAsPlainText --value false
Gets Azure AD app registration roles
When creating applications that use Azure AD authentication we can define custom roles that we can assign permissions to users or apps. The application defines and publishes the app roles and interprets them as permissions during authorization.
To return the roles published by an Azure AD application registration by its name, execute:
m365 aad app role list --appName "My app"
Get the value of a CLI for Microsoft 365 configuration option
We recently announced that we added support for configuring the CLI to your own preferences using the cli config set command, this enables you to change some of the default settings such as changing all command outputs to be JSON rather than text.
To return the current value of a CLI configuration option, execute:
m365 cli config get --key output
Upload files using Microsoft Graph
The ability to upload files has been possible in the CLI for some time using the spo file add command, this command however uses SharePoint-based APIs to perform the upload and does not support new authorisation features such as the ability to control app access to specific site collections using the Sites.Selected permission scope.
To add support for the new permission scope, we have added a new command that uses the Microsoft Graph in its implementation, the existing spo file add command will remain to provide backwards compatibility.
To add a file to a specific site, execute:
m365 file add --filePath file.pdf --folderUrl "https://contoso.sharepoint.com/Shared Documents"
Remove a specified Power App
Microsoft Power Apps is a popular no/low code business application development platform in Microsoft 365 and managing apps created by business users is an important maintenance tasks for administrators. We have extended our support for Power Apps by introducing a command to remove Power Apps from an environment.
To remove a specified Microsoft Power App, execute:
m365 pa app remove --name 3989cb59-ce1a-4a5c-bb78-257c5c39381d
Updates a specific application permission for a site
The Microsoft Graph gives us the ability to create site permissions on SharePoint Online or OneDrive sites, which has been possible in the CLI using the spo site apppermission add command, however it was not possible to update these registrations so we have added a new command to add that support.
To update a specific application permission by its name on a given site collection, execute:
m365 spo site apppermission set --siteUrl https://contoso.sharepoint.com/sites/project-x --appDisplayName Foo --permission read
npm i -g @pnp/cli-microsoft365
docker run --rm -it m365pnp/cli-microsoft365:latest
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.