Skip to content

With the CLI for Microsoft 365 VS Code extension, you can quickly learn, code and create scripts that use CLI for Microsoft 365 commands.

License

Notifications You must be signed in to change notification settings

pnp/vscode-cli-microsoft365

Repository files navigation

CLI for Microsoft 365 extension

version installs

This extension provides functionalities that may be helpful when creating scripts that use CLI for Microsoft 365. Currently, the extension provides:

  • embedded documentation
  • samples powered by PnP Script Sample Gallery
  • snippets with all possible CLI for Microsoft 365 commands

Please check CLI for Microsoft 365 docs for more information.

samples

✨ Capabilities

1️⃣ Script samples gallery

Using CLI M365: Open samples gallery command or 'Samples' button you may open the gallery with all available samples. Currently, the samples shown are retrieved from the PnP script samples repository. From the samples gallery you may go to the sample location or create a new tab in the editor prefilled with the CLI for Microsoft 365 script. It is possible to search for samples by:

  • title
  • authors
  • commands used in samples

samples

2️⃣ Docs

This functionality provides CLI docs view for all commands inside VS Code. No more transition between the code editor and browser is needed. It is possible to go to docs original website location and also open a sample gallery showing all samples using the command.

docs docs

It is also possible to use the command CLI M365: Open docs for command to open the docs for a specific command.

docs

3️⃣ Snippets

The extensions help to quickly find the proper CLI for Microsoft 365 command and add it into the code using snippets. The command is added along with all obligatory parameters. It is possible to move between parameters using 'Tab' key quickly. Each CLI command snippet is also provided with the same description as may be found in the docs which is a great help to understand the commands functionality quickly.

snippetsList

In order to use snippets please type part of a snippet and press enter or tab. The command will be automatic with the possibility to provide obligatory parameters. You may also use 'Ctrl + Space' (Windows, Linux) or 'Cmd + Space' (macOS) to activate snippets from within the editor.

snippetsList

It is also possible to use the command Insert Snippet in VS Code to see the full list

snippetsList

4️⃣ Actions

The extension provides additional links above the command list which allows opening docs web page, GitHub repository, and CLI for Microsoft 365 Discord server in your default browser.

commandActions

🤖 Commands

The extension provides the following commands:

command description
CLI M365: Open samples gallery Opens up the sample gallery
CLI M365: Open docs for command Search for command doc file. The command may also be prefilled by the selected CLI for Microsoft 365 command

commands

📑 Language

Currently, the extension supports the following language:

  • shellscript
  • powershell
  • javascript

languageSupport

🙋 Support

This project is a community lead extension provided by the Microsoft 365 and Power Platform Community members. Questions, problems, or feedback is more than welcome. Please create an issue in the extension repository issue list.

👍 Community

Are you building experiences for Microsoft 365? - Everyone is welcome to join our Microsoft 365 and Power Platform Community efforts with community calls, samples and guidance. Join our weekly community calls for Microsoft 365 and Power Platform topics or engage with us on Discord. Everyone is welcome 🧡

🧾 Code of Conduct

This project has adopted the Microsoft Open Source Code of Conduct. For more information, see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

😍 "Sharing is Caring"

Microsoft 365 & Power Platform Community

🔑 License

MIT License

⚠️ Disclaimer

THIS CODE IS PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.