CLI for Microsoft 365 v6.11

CLI for Microsoft 365 v6.11

Introducing the latest release of CLI for Microsoft 365

CLI for Microsoft 365 is a cross-platform command line tool based on Node.js that helps you manage many things around Microsoft 365 and your SPFx project. You may manage OneDrive, Planner, Power Apps and Automate, Teams, Viva Engage (Yammer), SharePoint (of course), and many many more. The list keeps on growing and growing. In this minor release, we introduced new commands as well as a tonne of improvements.

Explore the release notes to discover an array of exciting features and improvements that will revolutionize your Microsoft 365 journey.

Last minor release before v7

Before we will have a deep dive on what’s added in this release it’s worth mentioning that the v7 release is just around the corner. We are planning to go live next month so be sure you prepare yourself in advance. You may check out the upgrade guidance directly in the repo today.

You may also install the upcoming release and give it a try:

npm i -g @pnp/cli-microsoft365@seven

What’s new

In this minor release, we added a couple of new commands and enhancements to the existing functionality. Check out some of the awesome stuff added and be sure to try them out.

Power Apps management

In the last release we introduced a couple of new commands that allowed you to manage Power Apps apps and we are not slowing down. In this release, we added two more commands to give you more control over permission management.

The first one is the pa app permission ensure command that will allow you to assign or update permissions to a Power Apps app. Let’s check out what is possible.

For example to add co-owner permissions for a security group to a Power Apps app simply run:

m365 pa app permission ensure --appName bc9f0a7e-53df-46af-b669-5888bb2f63d0 --groupName Developers --roleName CanEdit

Or to share a Power Apps app with everyone in the tenant, use:

m365 pa app permission ensure --appName bc9f0a7e-53df-46af-b669-5888bb2f63d0 --roleName CanView --tenant

We also introduced a new command that allows you to remove permissions to a Power Apps app.

Thanks to that, you may for example remove permissions of a specific user for a specific app by running:

m365 pa app permission remove --appName bc9f0a7e-53df-46af-b669-5888bb2f63d0 --userName john.doe@contoso.com

Or to unshare a Power Apps app with the entire tenant

m365 pa app permission remove --appName bc9f0a7e-53df-46af-b669-5888bb2f63d0 --tenant

CLI config management

You may configure CLI for Microsoft 365 to meet your personal preferences. Thanks to that you may, for example, configure how CLI should behave in case a URL is returned or what should be the default output mode, or configure CLI to prompt for missing values in required options, or so much much more that if you haven’t, you should definitely give it a check. In this release, we added a command that allows you to have a quick overview of all self-set configurations.

To list all self-set configuration keys with their value, simply run:

m365 cli config list

For more information, check out:

Add a CI/CD pipeline to your SPFx project with ease

I will be honest, this is one of our personal favorites. Who wouldn’t want some kind of flow that will automatically build, package, and deploy your solution after adding a new feature to your code base? In the IT world, we use workflows (pipelines) for exactly that. We added a new command that will generate a YAML GitHub workflow for a given SPFx project, giving you a huge head start in creating a good quality CI/CD flow. Let’s check out what’s possible.

To add a GitHub workflow for a SharePoint Framework project that uses an application login and triggers for every push to the main branch, you should run:

m365 spfx project github workflow add

To do the same but with user login method just run:

m365 spfx project github workflow add --manuallyTrigger --loginMethod "user"

And if you want to have a CI/CD pipeline to deploy your app to a site level app catalog just run:

m365 spfx project github workflow add --scope "sitecollection" --siteUrl "https://some.sharepoint.com/sites/someSite"

For more information, check out the documentation for each command:

SharePoint Framework Projects v1.18.0-beta.5 support

Staying up to date is crucial if you want to be prepared for what’s coming but upgrading an SPFx solution may sometimes not be a fair fight. Luckily for you, CLI for Microsoft 365 has a couple of commands that may save you a lot of time. In this release, we added the support for SPFx v1.18.0-beta.5 to three of our most popular commands: spfx project upgrade, spfx project doctor, and spfx doctor.

Here are the commands to get you started:

m365 spfx project upgrade --output md
m365 spfx doctor --output text
m365 spfx project doctor --output md

For more information, check out the documentation for each command:

Extended the ‘spo file copy’ command

In this release, we also improved the spo file copy command with two new options. One of them is definitely worth checking as it allows to clear the author and created date. Let’s check it out in action.

To copy a file by site-relative URL to a document library in another site collection and clear the author and created date simply run:

m365 spo file copy --webUrl https://contoso.sharepoint.com/sites/project --sourceUrl "/Shared Documents/Document.pdf" --targetUrl "/sites/IT/Shared Documents" --resetAuthorAndCreated

Check out the related issue to find out more.

New contributing guidance

Not so long ago we migrated our docs to a new static site generator adding a couple of awesome features along the way like AI search powered by Mendable. In this release, we worked on adding more valuable content and added a new section with contributing guidance to the CLI for Microsoft 365. How to add a new command? How to add unit tests? How to add a new script sample? All that and much much more will become super clear after checking out our contribute section.

The fun never stops, improving our codebase

In this minor release, we continued our work on refactoring the code base to embrace the asynchronous programming model using async/await. All this would not have been possible without our awesome contributors and their dedication to CLI for Microsoft 365. Just have a look at the list to get a feeling of the amount of work already done and what is left.

We’ve also taken the first steps to refactor our codebase to centralize the shared code in util functions. This refactor will bring a performance boost to the tool as well as allow easier integration and testing. Check out the related issue to go over the details.

What else

If you are eager to go over all of the details and improvements added in this release, do not hesitate to check out the release notes to find out more.

Upcoming changes

Curious about what lies ahead? We’re excited to share some of our ongoing projects and initiatives.

Expanding command arsenal

Our relentless pursuit of empowering your Microsoft 365 experience continues. We’re actively working on introducing more commands to CLI for Microsoft 365. From Power Platform to SharePoint Online, we’re exploring various services to enhance your command-line capabilities. Additionally, we’re dedicated to refactoring our codebase to embrace the power of async/await, further improving performance and readability.

But we don’t stop there. We value your input and ideas. If you have any suggestions for new commands, don’t hesitate to share them with us. Create a new issue on our GitHub Issues list or join our vibrant community Discord server to engage in discussions.

Together, let’s shape the future of CLI for Microsoft 365 and unlock even greater possibilities.

Contributors

We want to extend our heartfelt appreciation to the incredible individuals who have made this release possible. Without their valuable contributions and dedication, CLI for Microsoft 365 wouldn’t be where it is today. Let’s give a round of applause to the following contributors (in alphabetical order):

We express our deepest gratitude for the time and effort you have invested in CLI for Microsoft 365, improving its progress and enriching its capabilities. Your contributions have played a significant role in advancing this project and empowering users worldwide. Thank you for your commitment and valuable assistance!

High fives

We would like to give a big shoutout and high fives to the amazing individuals who have shared their invaluable feedback and ideas for improving CLI for Microsoft 365. We greatly appreciate your engagement and contribution to the growth of our platform. Let’s celebrate the following users (in alphabetical order) for taking the time to provide us with their insights:

Your feedback has been instrumental in shaping the direction of CLI for Microsoft 365, and we are grateful for your involvement in making our platform even better. Your active participation and valuable insights continue to drive innovation and enhance the user experience for all. Thank you for being an essential part of our community!

Get Started Today!

Experience the power of CLI for Microsoft 365 by getting the latest release from npm:

npm i -g @pnp/cli-microsoft365

Alternatively, you can access the latest release from Docker:

docker run --rm -it m365pnp/cli-microsoft365:latest

Need More Information?

For additional guidance on getting started or to explore detailed information about commands, architecture, or the project itself, visit aka.ms/cli-m365.

Stay Connected!

We value your feedback and are eager to hear from you. If you have any suggestions for improvement or want to engage with our community, you can reach out to us on GitHub, Discord, or Twit… sorry X. Don’t hesitate to connect with us; your input plays a vital role in shaping the future of CLI for Microsoft 365.