From 7d120a02f6e3f04832810f6ce14730ba3dff3b3a Mon Sep 17 00:00:00 2001 From: Michele Cereda Date: Thu, 6 Apr 2023 18:05:22 +0200 Subject: [PATCH] chore: added notes about m365 cli --- knowledge base/m365.md | 67 +++++++++++++++++++++++++++++++++++++++ knowledge base/node.js.md | 34 ++++++++++++++++++++ knowledge base/npm.md | 42 ++++++++++++++++++++++++ 3 files changed, 143 insertions(+) create mode 100644 knowledge base/m365.md create mode 100644 knowledge base/node.js.md create mode 100644 knowledge base/npm.md diff --git a/knowledge base/m365.md b/knowledge base/m365.md new file mode 100644 index 0000000..2e095f9 --- /dev/null +++ b/knowledge base/m365.md @@ -0,0 +1,67 @@ +# `m365` + +CLI tool for Microsoft 365. + +## Table of contents + +1. [TL:DR](#tldr) +1. [Further readings](#further-readings) +1. [Sources](#sources) + +## TL:DR + +```sh +# Installation. +npm install -g '@pnp/cli-microsoft365' +yarn global add '@pnp/cli-microsoft365' +docker run --rm -it 'm365pnp/cli-microsoft365':'latest' + +# Disable telemetry. +m365 cli config set -k 'disableTelemetry' -v 'true' + +# Login to Microsoft 365. +m365 login -t 'browser' +m365 login --authType 'password' \ + --userName 'user@contoso.com' --password 'pass@word1' +m365 login --authType 'certificate' \ + --certificateFile 'path/to/cert.pfx' --password 'pass@word1' + +# Check the current login status. +m365 status + +# Send messages to a chat in Teams. +# Specify *only one* of 'chatId', 'chatName' or 'userEmails'. +m365 teams chat message send --chatId 'chat-uuid' -m 'hello world' +m365 teams chat message send --chatName 'chat-display-name' -m 'hello world' +m365 teams chat message send -e 'user-email-1,…,user-email-N' -m 'hello world' +m365 teams chat message send … -m 'hello world' + +# Send messages to a channel in Teams. +m365 teams message send -t 'team-uuid' -c 'channel-uuid' -m 'hello world' +m365 teams message send … -m 'hello world' + +# Logout. +m365 logout +``` + +## Further readings + +- [Website] +- [Github] +- [node.js] +- [`npm`][npm] + +## Sources + +All the references in the [further readings] section, plus the following: + + +[github]: https://github.com/pnp/cli-microsoft365 +[website]: https://pnp.github.io/cli-microsoft365/ + + +[further readings]: #further-readings +[node.js]: node.js.md +[npm]: npm.md + + diff --git a/knowledge base/node.js.md b/knowledge base/node.js.md new file mode 100644 index 0000000..26e5567 --- /dev/null +++ b/knowledge base/node.js.md @@ -0,0 +1,34 @@ +# Node.js + +Open-source, cross-platform JavaScript runtime environment. + +## Table of contents + +1. [TL:DR](#tldr) +1. [Further readings](#further-readings) +1. [Sources](#sources) + +## TL:DR + +```sh +# Use a custom CA certificate. +export NODE_EXTRA_CA_CERTS='path/to/trusted/ca/cert.pem' +``` + +## Further readings + +- [Website] +- [`npm`][npm] + +## Sources + +All the references in the [further readings] section, plus the following: + + +[website]: https://nodejs.org/en + + +[further readings]: #further-readings +[npm]: npm.md + + diff --git a/knowledge base/npm.md b/knowledge base/npm.md new file mode 100644 index 0000000..ad7ccdf --- /dev/null +++ b/knowledge base/npm.md @@ -0,0 +1,42 @@ +# Node Package Manager CLI + +## Table of contents + +1. [TL:DR](#tldr) +1. [Further readings](#further-readings) +1. [Sources](#sources) + +## TL:DR + +```sh +# Disable SSL verification. +npm config set 'strict-ssl'='false' + +# Use a custom CA certificate. +npm config set 'cafile'='path/to/ca/cert.pem' + +# Install packages. +npm install '@pnp/cli-microsoft365' +npm install -g '@pnp/cli-microsoft365@latest' + +# Remove packages. +npm uninstall '@pnp/cli-microsoft365' +``` + +## Further readings + +- Official [documentation] +- [node.js] + +## Sources + +All the references in the [further readings] section, plus the following: + + +[documentation]: https://docs.npmjs.com/cli/ + + +[further readings]: #further-readings +[node.js]: node.js.md + +