@pnp/cli-microsoft365 5.0.0-beta.6d4dbfb → 5.0.0-beta.6e613c5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/.devcontainer/devcontainer.json +12 -9
  2. package/.eslintrc.js +1 -0
  3. package/.mocharc.json +9 -0
  4. package/README.md +2 -2
  5. package/dist/Command.js +1 -1
  6. package/dist/api.d.ts +11 -0
  7. package/dist/api.js +17 -0
  8. package/dist/cli/Cli.js +19 -4
  9. package/dist/m365/aad/commands/app/app-add.js +43 -7
  10. package/dist/m365/aad/commands/app/app-delete.js +123 -0
  11. package/dist/m365/aad/commands/app/app-get.js +56 -11
  12. package/dist/m365/aad/commands/app/app-set.js +98 -3
  13. package/dist/m365/aad/commands/group/group-list.js +14 -1
  14. package/dist/m365/aad/commands/o365group/o365group-conversation-list.js +41 -0
  15. package/dist/m365/aad/commands.js +2 -0
  16. package/dist/m365/outlook/commands/room/room-list.js +43 -0
  17. package/dist/m365/outlook/commands/roomlist/roomlist-list.js +25 -0
  18. package/dist/m365/outlook/commands.js +2 -0
  19. package/dist/m365/planner/commands/task/task-get.js +1 -1
  20. package/dist/m365/planner/commands/task/task-list.js +37 -7
  21. package/dist/m365/spfx/commands/project/project-upgrade/{upgrade-1.14.0-beta.5.js → upgrade-1.14.0-rc.2.js} +25 -25
  22. package/dist/m365/spfx/commands/project/project-upgrade.js +1 -1
  23. package/dist/m365/spo/commands/group/group-user-add.js +15 -8
  24. package/dist/m365/teams/commands/app/app-install.js +75 -21
  25. package/dist/m365/teams/commands/channel/channel-get.js +29 -7
  26. package/dist/m365/teams/commands/chat/chat-message-send.js +225 -0
  27. package/dist/m365/teams/commands.js +1 -0
  28. package/docs/docs/cmd/aad/app/app-delete.md +51 -0
  29. package/docs/docs/cmd/aad/app/app-get.md +12 -1
  30. package/docs/docs/cmd/aad/app/app-set.md +21 -0
  31. package/docs/docs/cmd/aad/group/group-list.md +9 -0
  32. package/docs/docs/cmd/aad/o365group/o365group-conversation-list.md +24 -0
  33. package/docs/docs/cmd/outlook/room/room-list.md +30 -0
  34. package/docs/docs/cmd/outlook/roomlist/roomlist-list.md +21 -0
  35. package/docs/docs/cmd/planner/task/task-get.md +5 -0
  36. package/docs/docs/cmd/planner/task/task-list.md +5 -0
  37. package/docs/docs/cmd/search/externalconnection/externalconnection-add.md +3 -3
  38. package/docs/docs/cmd/spo/group/group-user-add.md +4 -0
  39. package/docs/docs/cmd/teams/app/app-install.md +22 -4
  40. package/docs/docs/cmd/teams/channel/channel-get.md +10 -1
  41. package/docs/docs/cmd/teams/chat/chat-message-send.md +55 -0
  42. package/npm-shrinkwrap.json +36 -3
  43. package/package.json +8 -3
@@ -0,0 +1,225 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ const os = require("os");
13
+ const Auth_1 = require("../../../../Auth");
14
+ const request_1 = require("../../../../request");
15
+ const Utils_1 = require("../../../../Utils");
16
+ const GraphCommand_1 = require("../../../base/GraphCommand");
17
+ const commands_1 = require("../../commands");
18
+ class TeamsChatMessageSendCommand extends GraphCommand_1.default {
19
+ get name() {
20
+ return commands_1.default.CHAT_MESSAGE_SEND;
21
+ }
22
+ get description() {
23
+ return 'Send a message to an existing or new chat conversation.';
24
+ }
25
+ commandAction(logger, args, cb) {
26
+ return __awaiter(this, void 0, void 0, function* () {
27
+ try {
28
+ const chatId = args.options.chatId
29
+ || args.options.userEmails && (yield this.ensureChatIdByUserEmails(args.options.userEmails))
30
+ || args.options.chatName && (yield this.getChatIdByName(args.options.chatName));
31
+ yield this.sendChatMessage(chatId, args.options);
32
+ cb();
33
+ }
34
+ catch (error) {
35
+ this.handleRejectedODataJsonPromise(error, logger, cb);
36
+ }
37
+ });
38
+ }
39
+ options() {
40
+ const options = [
41
+ {
42
+ option: '--chatId [chatId]'
43
+ },
44
+ {
45
+ option: '-e, --userEmails [userEmails]'
46
+ },
47
+ {
48
+ option: '--chatName [chatName]'
49
+ },
50
+ {
51
+ option: '-m, --message <message>'
52
+ }
53
+ ];
54
+ const parentOptions = super.options();
55
+ return options.concat(parentOptions);
56
+ }
57
+ validate(args) {
58
+ if (!args.options.chatId && !args.options.userEmails && !args.options.chatName) {
59
+ return 'Specify chatId or userEmails or chatName, one is required.';
60
+ }
61
+ let nrOfMutuallyExclusiveOptionsInUse = 0;
62
+ if (args.options.chatId) {
63
+ nrOfMutuallyExclusiveOptionsInUse++;
64
+ }
65
+ if (args.options.userEmails) {
66
+ nrOfMutuallyExclusiveOptionsInUse++;
67
+ }
68
+ if (args.options.chatName) {
69
+ nrOfMutuallyExclusiveOptionsInUse++;
70
+ }
71
+ if (nrOfMutuallyExclusiveOptionsInUse > 1) {
72
+ return 'Specify either chatId or userEmails or chatName, but not multiple.';
73
+ }
74
+ if (!args.options.message) {
75
+ return 'Specify a message to send.';
76
+ }
77
+ if (args.options.chatId && !Utils_1.default.isValidTeamsChatId(args.options.chatId)) {
78
+ return `${args.options.chatId} is not a valid Teams ChatId.`;
79
+ }
80
+ if (args.options.userEmails) {
81
+ const userEmails = args.options.userEmails.toLowerCase().replace(/\s/g, '').split(',').filter(e => e && e !== '');
82
+ if (!userEmails || userEmails.length === 0 || userEmails.some(e => !Utils_1.default.isValidUserPrincipalName(e))) {
83
+ return `${args.options.userEmails} contains one or more invalid email addresses.`;
84
+ }
85
+ }
86
+ return true;
87
+ }
88
+ ensureChatIdByUserEmails(userEmailsOption) {
89
+ return __awaiter(this, void 0, void 0, function* () {
90
+ const userEmails = userEmailsOption.toLowerCase().replace(/\s/g, '').split(',').filter(e => e && e !== '');
91
+ const currentUserEmail = Utils_1.default.getUserNameFromAccessToken(Auth_1.default.service.accessTokens[this.resource].accessToken).toLowerCase();
92
+ const existingChats = yield this.findExistingGroupChatsByMembers([currentUserEmail, ...userEmails]);
93
+ if (existingChats && existingChats.length > 0) {
94
+ if (existingChats.length > 1) {
95
+ const disambiguationText = existingChats.map(c => {
96
+ return `- ${c.id}${c.topic && ' - '}${c.topic} - ${c.createdDateTime && new Date(c.createdDateTime).toLocaleString()}`;
97
+ }).join(os.EOL);
98
+ throw new Error(`Multiple chat conversations with this topic found. Please disambiguate:${os.EOL}${disambiguationText}`);
99
+ }
100
+ else {
101
+ return existingChats[0].id;
102
+ }
103
+ }
104
+ const chat = yield this.createConversation([currentUserEmail, ...userEmails]);
105
+ return chat.id;
106
+ });
107
+ }
108
+ getChatIdByName(chatName) {
109
+ return __awaiter(this, void 0, void 0, function* () {
110
+ const existingChats = yield this.findExistingGroupChatsByTopic(chatName);
111
+ if (!existingChats || existingChats.length === 0) {
112
+ throw new Error('No chat conversation was found with this name.');
113
+ }
114
+ if (existingChats.length === 1) {
115
+ return existingChats[0].id;
116
+ }
117
+ const disambiguationText = existingChats.map(c => {
118
+ const memberstring = c.members.map(m => m.email).join(', ');
119
+ return `- ${c.id} - ${c.createdDateTime && new Date(c.createdDateTime).toLocaleString()} - ${memberstring}`;
120
+ }).join(os.EOL);
121
+ throw new Error(`Multiple chat conversations with this topic found. Please disambiguate:${os.EOL}${disambiguationText}`);
122
+ });
123
+ }
124
+ // This Microsoft Graph API request throws an intermittent 404 exception, saying that it cannot find the principal.
125
+ // The same behavior occurs when creating the conversation through the Graph Explorer.
126
+ // It seems to happen when the userEmail casing does not match the casing of the actual UPN.
127
+ // When the first request throws an error, the second request does succeed.
128
+ // Therefore a retry-mechanism is implemented here.
129
+ createConversation(memberEmails, retried = 0) {
130
+ var _a;
131
+ return __awaiter(this, void 0, void 0, function* () {
132
+ try {
133
+ const jsonBody = {
134
+ chatType: memberEmails.length > 2 ? 'group' : 'oneOnOne',
135
+ members: memberEmails.map(email => {
136
+ return {
137
+ '@odata.type': '#microsoft.graph.aadUserConversationMember',
138
+ roles: ['owner'],
139
+ 'user@odata.bind': `https://graph.microsoft.com/v1.0/users/${email}`
140
+ };
141
+ })
142
+ };
143
+ const requestOptions = {
144
+ url: `${this.resource}/v1.0/chats`,
145
+ headers: {
146
+ accept: 'application/json;odata.metadata=none',
147
+ 'content-type': 'application/json;odata=nometadata'
148
+ },
149
+ responseType: 'json',
150
+ data: jsonBody
151
+ };
152
+ return yield request_1.default.post(requestOptions);
153
+ }
154
+ catch (err) {
155
+ if (((_a = err.message) === null || _a === void 0 ? void 0 : _a.indexOf('404')) > -1 && retried < 4) {
156
+ return yield this.createConversation(memberEmails, retried + 1);
157
+ }
158
+ throw err;
159
+ }
160
+ });
161
+ }
162
+ sendChatMessage(chatId, options) {
163
+ return __awaiter(this, void 0, void 0, function* () {
164
+ const requestOptions = {
165
+ url: `${this.resource}/v1.0/chats/${chatId}/messages`,
166
+ headers: {
167
+ accept: 'application/json;odata.metadata=none',
168
+ 'content-type': 'application/json;odata=nometadata'
169
+ },
170
+ responseType: 'json',
171
+ data: {
172
+ body: {
173
+ content: options.message
174
+ }
175
+ }
176
+ };
177
+ yield request_1.default.post(requestOptions);
178
+ });
179
+ }
180
+ findExistingGroupChatsByMembers(expectedMemberEmails) {
181
+ return __awaiter(this, void 0, void 0, function* () {
182
+ const endpoint = `${this.resource}/v1.0/chats?$filter=chatType eq 'group'&$expand=members&$select=id,topic,createdDateTime,members`;
183
+ const foundChats = [];
184
+ const chats = yield this.getAllChats(endpoint, []);
185
+ for (const chat of chats) {
186
+ const chatMembers = chat.members;
187
+ if (chatMembers.length === expectedMemberEmails.length) {
188
+ const chatMemberEmails = chatMembers.map(member => { var _a; return (_a = member.email) === null || _a === void 0 ? void 0 : _a.toLowerCase(); });
189
+ if (expectedMemberEmails.every(email => chatMemberEmails.some(memberEmail => memberEmail === email))) {
190
+ foundChats.push(chat);
191
+ }
192
+ }
193
+ }
194
+ return foundChats;
195
+ });
196
+ }
197
+ findExistingGroupChatsByTopic(topic) {
198
+ return __awaiter(this, void 0, void 0, function* () {
199
+ const endpoint = `${this.resource}/v1.0/chats?$filter=topic eq '${encodeURIComponent(topic)}'&$expand=members&$select=id,topic,createdDateTime,chatType`;
200
+ const chats = yield this.getAllChats(endpoint, []);
201
+ return chats;
202
+ });
203
+ }
204
+ getAllChats(url, items) {
205
+ return __awaiter(this, void 0, void 0, function* () {
206
+ const requestOptions = {
207
+ url: url,
208
+ headers: {
209
+ accept: 'application/json;odata.metadata=none'
210
+ },
211
+ responseType: 'json'
212
+ };
213
+ const res = yield request_1.default.get(requestOptions);
214
+ items = items.concat(res.value);
215
+ if (res['@odata.nextLink']) {
216
+ return yield this.getAllChats(res['@odata.nextLink'], items);
217
+ }
218
+ else {
219
+ return items;
220
+ }
221
+ });
222
+ }
223
+ }
224
+ module.exports = new TeamsChatMessageSendCommand();
225
+ //# sourceMappingURL=chat-message-send.js.map
@@ -16,6 +16,7 @@ exports.default = {
16
16
  CHAT_LIST: `${prefix} chat list`,
17
17
  CHAT_MEMBER_LIST: `${prefix} chat member list`,
18
18
  CHAT_MESSAGE_LIST: `${prefix} chat message list`,
19
+ CHAT_MESSAGE_SEND: `${prefix} chat message send`,
19
20
  CONVERSATIONMEMBER_ADD: `${prefix} conversationmember add`,
20
21
  CONVERSATIONMEMBER_LIST: `${prefix} conversationmember list`,
21
22
  FUNSETTINGS_LIST: `${prefix} funsettings list`,
@@ -0,0 +1,51 @@
1
+ # aad app delete
2
+
3
+ Removes an Azure AD app registration
4
+
5
+ ## Usage
6
+
7
+ ```sh
8
+ m365 aad app delete [options]
9
+ ```
10
+
11
+ ## Options
12
+
13
+ `--appId [appId]`
14
+ : Application (client) ID of the Azure AD application registration to remove. Specify either `appId`, `objectId` or `name`
15
+
16
+ `--objectId [objectId]`
17
+ : Object ID of the Azure AD application registration to remove. Specify either `appId`, `objectId` or `name`
18
+
19
+ `--name [name]`
20
+ : Name of the Azure AD application registration to remove. Specify either `appId`, `objectId` or `name`
21
+
22
+ `--confirm`:
23
+ : Don't prompt for confirmation to delete the app
24
+
25
+ --8<-- "docs/cmd/_global.md"
26
+
27
+ ## Remarks
28
+
29
+ For best performance use the `objectId` option to reference the Azure AD application registration to delete. If you use `appId` or `name`, this command will first need to find the corresponding object ID for that application.
30
+
31
+ If the command finds multiple Azure AD application registrations with the specified app name, it will prompt you to disambiguate which app it should use, listing the discovered object IDs.
32
+
33
+ ## Examples
34
+
35
+ Delete the Azure AD application registration by its app (client) ID
36
+
37
+ ```sh
38
+ m365 aad app delete --appId d75be2e1-0204-4f95-857d-51a37cf40be8
39
+ ```
40
+
41
+ Delete the Azure AD application registration by its object ID
42
+
43
+ ```sh
44
+ m365 aad app delete --objectId d75be2e1-0204-4f95-857d-51a37cf40be8
45
+ ```
46
+
47
+ Delete the Azure AD application registration by its name. Will NOT prompt for confirmation before deleting.
48
+
49
+ ```sh
50
+ m365 aad app delete --name "My app" --confirm
51
+ ```
@@ -19,14 +19,19 @@ m365 aad app get [options]
19
19
  `--name [name]`
20
20
  : Name of the Azure AD application registration to get. Specify either `appId`, `objectId` or `name`
21
21
 
22
+ `--save`
23
+ : Use to store the information about the created app in a local file
24
+
22
25
  --8<-- "docs/cmd/_global.md"
23
26
 
24
27
  ## Remarks
25
28
 
26
- For best performance use the `objectId` option to reference the Azure AD application registration to update. If you use `appId` or `name`, this command will first need to find the corresponding object ID for that application.
29
+ For best performance use the `objectId` option to reference the Azure AD application registration to get. If you use `appId` or `name`, this command will first need to find the corresponding object ID for that application.
27
30
 
28
31
  If the command finds multiple Azure AD application registrations with the specified app name, it will prompt you to disambiguate which app it should use, listing the discovered object IDs.
29
32
 
33
+ If you want to store the information about the Azure AD app registration, use the `--save` option. This is useful when you build solutions connected to Microsoft 365 and want to easily manage app registrations used with your solution. When you use the `--save` option, after you get the app registration, the command will write its ID and name to the `.m365rc.json` file in the current directory. If the file already exists, it will add the information about the App registration to it if it's not already present, allowing you to track multiple apps. If the file doesn't exist, the command will create it.
34
+
30
35
  ## Examples
31
36
 
32
37
  Get the Azure AD application registration by its app (client) ID
@@ -46,3 +51,9 @@ Get the Azure AD application registration by its name
46
51
  ```sh
47
52
  m365 aad app get --name "My app"
48
53
  ```
54
+
55
+ Get the Azure AD application registration by its name. Store information about the retrieved app registration in the _.m365rc.json_ file in the current directory.
56
+
57
+ ```sh
58
+ m365 aad app get --name "My app" --save
59
+ ```
@@ -22,6 +22,15 @@ m365 aad app set [options]
22
22
  `-u, --uri [uri]`
23
23
  : Application ID URI to update
24
24
 
25
+ `-r, --redirectUris [redirectUris]`
26
+ : Comma-separated list of redirect URIs to add to the app registration. Requires `platform` to be specified
27
+
28
+ `-p, --platform [platform]`
29
+ : Platform for which the `redirectUri` should be configured. Allowed values `spa,web,publicClient`
30
+
31
+ `--redirectUrisToRemove [redirectUrisToRemove]`
32
+ : Comma-separated list of existing redirect URIs to remove. Specify, when you want to replace existing redirect URIs with another
33
+
25
34
  --8<-- "docs/cmd/_global.md"
26
35
 
27
36
  ## Remarks
@@ -49,3 +58,15 @@ Update the app URI of the Azure AD application registration specified by its nam
49
58
  ```sh
50
59
  m365 aad app set --name "My app" --uri https://contoso.com/e75be2e1-0204-4f95-857d-51a37cf40be8
51
60
  ```
61
+
62
+ Add a new redirect URI for SPA authentication
63
+
64
+ ```sh
65
+ m365 aad app set --objectId 95cfe30d-ed44-4f9d-b73d-c66560f72e83 --redirectUris https://contoso.com/auth --platform spa
66
+ ```
67
+
68
+ Replace one redirect URI with another for SPA authentication
69
+
70
+ ```sh
71
+ m365 aad app set --objectId 95cfe30d-ed44-4f9d-b73d-c66560f72e83 --redirectUris https://contoso.com/auth --platform spa --redirectUrisToRemove https://contoso.com/old-auth
72
+ ```
@@ -10,6 +10,9 @@ m365 aad group list [options]
10
10
 
11
11
  ## Options
12
12
 
13
+ `-d, --deleted`
14
+ : Use to retrieve deleted groups
15
+
13
16
  --8<-- "docs/cmd/_global.md"
14
17
 
15
18
  ## Examples
@@ -18,4 +21,10 @@ Lists all groups defined in Azure Active Directory.
18
21
 
19
22
  ```sh
20
23
  m365 aad group list
24
+ ```
25
+
26
+ List all recently deleted groups in the tenant
27
+
28
+ ```sh
29
+ m365 aad group list --deleted
21
30
  ```
@@ -0,0 +1,24 @@
1
+ # aad o365group conversation list
2
+
3
+ Lists conversations for the specified Microsoft 365 group
4
+
5
+ ## Usage
6
+
7
+ ```sh
8
+ m365 aad o365group conversation list [options]
9
+ ```
10
+
11
+ ## Options
12
+
13
+ `-i, --groupId <groupId>`
14
+ : The ID of the Microsoft 365 group
15
+
16
+ --8<-- "docs/cmd/_global.md"
17
+
18
+ ## Examples
19
+
20
+ Lists conversations for the specified Microsoft 365 group
21
+
22
+ ```sh
23
+ m365 aad o365group conversation list --groupId '00000000-0000-0000-0000-000000000000'
24
+ ```
@@ -0,0 +1,30 @@
1
+ # outlook room list
2
+
3
+ Get a collection of all available rooms
4
+
5
+ ## Usage
6
+
7
+ ```sh
8
+ m365 outlook room list [options]
9
+ ```
10
+
11
+ ## Options
12
+
13
+ `--roomlistEmail [roomlistEmail]`
14
+ : Use to filter returned rooms by their roomlist email (eg. bldg2@contoso.com)
15
+
16
+ --8<-- "docs/cmd/_global.md"
17
+
18
+ ## Examples
19
+
20
+ Get all the rooms
21
+
22
+ ```sh
23
+ m365 outlook room list
24
+ ```
25
+
26
+ Get all the rooms of specified roomlist e-mail address
27
+
28
+ ```sh
29
+ m365 outlook room list --roomlistEmail "bldg2@contoso.com"
30
+ ```
@@ -0,0 +1,21 @@
1
+ # outlook roomlist list
2
+
3
+ Get a collection of available roomlists
4
+
5
+ ## Usage
6
+
7
+ ```sh
8
+ m365 outlook roomlist list [options]
9
+ ```
10
+
11
+ ## Options
12
+
13
+ --8<-- "docs/cmd/_global.md"
14
+
15
+ ## Examples
16
+
17
+ Get all roomlists in your tenant
18
+
19
+ ```sh
20
+ m365 outlook roomlist list
21
+ ```
@@ -15,6 +15,11 @@ m365 planner task get [options]
15
15
 
16
16
  --8<-- "docs/cmd/_global.md"
17
17
 
18
+ ## Remarks
19
+
20
+ !!! attention
21
+ This command uses an API that is currently in preview to enrich the results with the `priority` field. Keep in mind that this preview API is subject to change once the API reached general availability.
22
+
18
23
  ## Examples
19
24
 
20
25
  Retrieve the the specified planner task
@@ -30,6 +30,11 @@ m365 planner task list [options]
30
30
 
31
31
  --8<-- "docs/cmd/_global.md"
32
32
 
33
+ ## Remarks
34
+
35
+ !!! attention
36
+ This command uses API that is currently in preview to enrich the results with the `priority` field. Keep in mind that this preview API is subject to change once the API reached general availability.
37
+
33
38
  ## Examples
34
39
 
35
40
  List tasks for the currently logged in user
@@ -30,14 +30,14 @@ The `id` must be at least 3 and no more than 32 characters long. It can contain
30
30
 
31
31
  ## Examples
32
32
 
33
- Adds a new external connection with name and description of test
33
+ Adds a new external connection with name and description of test app
34
34
 
35
35
  ```sh
36
- m365 search externalconnection add --id MyApp --name "My application" --description "Description of your application"
36
+ m365 search externalconnection add --id MyApp --name "Test" --description "Test"
37
37
  ```
38
38
 
39
39
  Adds a new external connection with a limited number of authorized apps
40
40
 
41
41
  ```sh
42
- m365 search externalconnection add --id MyApp --name "My application" --description "Description of your application" --authorizedAppIds "00000000-0000-0000-0000-000000000000,00000000-0000-0000-0000-000000000001,00000000-0000-0000-0000-000000000002"
42
+ m365 search externalconnection add --id MyApp --name "Test" --description "Test" --authorizedAppIds "00000000-0000-0000-0000-000000000000,00000000-0000-0000-0000-000000000001,00000000-0000-0000-0000-000000000002"
43
43
  ```
@@ -27,6 +27,10 @@ m365 spo group user add [options]
27
27
 
28
28
  --8<-- "docs/cmd/_global.md"
29
29
 
30
+ ## Remarks
31
+
32
+ For the `--userName` or `--email` options you can specify multiple values by separating them with a comma. If one of the specified entries is not valid, the command will fail with an error message showing the list invalid values.
33
+
30
34
  ## Examples
31
35
 
32
36
  Add a user with name _Alex.Wilber@contoso.com_ to the SharePoint group with id _5_ available on the web _https://contoso.sharepoint.com/sites/SiteA_
@@ -1,6 +1,6 @@
1
1
  # teams app install
2
2
 
3
- Installs an app from the catalog to a Microsoft Teams team
3
+ Installs a Microsoft Teams team app from the catalog in the specified team or for the specified user
4
4
 
5
5
  ## Usage
6
6
 
@@ -13,14 +13,20 @@ m365 teams app install [options]
13
13
  `--appId <appId>`
14
14
  : The ID of the app to install
15
15
 
16
- `--teamId <teamId>`
16
+ `--teamId [teamId]`
17
17
  : The ID of the Microsoft Teams team to which to install the app
18
18
 
19
+ `--userId [userId]`
20
+ : The ID of the user for who to install the app. Specify either `userId` or `userName` to install a personal app for a user.
21
+
22
+ `--userName [userName]`
23
+ : The UPN of the user for who to install the app. Specify either `userId` or `userName` to install a personal app for a user.
24
+
19
25
  --8<-- "docs/cmd/_global.md"
20
26
 
21
27
  ## Remarks
22
28
 
23
- The `appId` has to be the ID of the app from the Microsoft Teams App Catalog. Do not use the ID from the manifest of the zip app package. Use the [teams app list](./app-list.md) command to get this ID.
29
+ The `appId` has to be the ID of the app from the Microsoft Teams App Catalog. Do not use the ID from the manifest of the zip app package. Use the [teams app list](./app-list.md) command to get this ID instead.
24
30
 
25
31
  ## Examples
26
32
 
@@ -28,4 +34,16 @@ Install an app from the catalog in a Microsoft Teams team
28
34
 
29
35
  ```sh
30
36
  m365 teams app install --appId 4440558e-8c73-4597-abc7-3644a64c4bce --teamId 2609af39-7775-4f94-a3dc-0dd67657e900
31
- ```
37
+ ```
38
+
39
+ Install a personal app for the user specified using their user name
40
+
41
+ ```sh
42
+ m365 teams app install --appId 4440558e-8c73-4597-abc7-3644a64c4bce --userName steve@contoso.com
43
+ ```
44
+
45
+ Install a personal app for the user specified using their ID
46
+
47
+ ```sh
48
+ m365 teams app install --appId 4440558e-8c73-4597-abc7-3644a64c4bce --userId 2609af39-7775-4f94-a3dc-0dd67657e900
49
+ ```
@@ -22,6 +22,9 @@ m365 teams channel get [options]
22
22
  `--channelName [channelName]`
23
23
  : The display name of the channel for which to retrieve more information. Specify either channelId or channelName but not both
24
24
 
25
+ `--primary`
26
+ : Gets the default channel, General, of a team. If specified, channelId or channelName are not needed
27
+
25
28
  --8<-- "docs/cmd/_global.md"
26
29
 
27
30
  ## Examples
@@ -36,4 +39,10 @@ Get information about Microsoft Teams team channel with name _Channel Name_
36
39
 
37
40
  ```sh
38
41
  m365 teams channel get --teamName "Team Name" --channelName "Channel Name"
39
- ```
42
+ ```
43
+
44
+ Get information about Microsoft Teams team primary channel , i.e. General
45
+
46
+ ```sh
47
+ m365 teams channel get --teamName "Team Name" --primary
48
+ ```
@@ -0,0 +1,55 @@
1
+ # teams chat message send
2
+
3
+ Sends a chat message to a Microsoft Teams chat conversation.
4
+
5
+ ## Usage
6
+
7
+ ```sh
8
+ m365 teams chat message send [options]
9
+ ```
10
+
11
+ ## Options
12
+
13
+ `--chatId [chatId]`
14
+ : The ID of the chat conversation. Specify either `chatId`, `chatName` or `userEmails`, but not multiple.
15
+
16
+ `--chatName [chatName]`
17
+ : The display name of the chat conversation. Specify either `chatId`, `chatName` or `userEmails`, but not multiple.
18
+
19
+ `-e, --userEmails [userEmails]`
20
+ : A comma-separated list of one or more e-mail addresses. Specify either `chatId`, `chatName` or `userEmails`, but not multiple.
21
+
22
+ `-m, --message <message>`
23
+ : The message to send
24
+
25
+ --8<-- "docs/cmd/_global.md"
26
+
27
+ ## Remarks
28
+
29
+ A new chat conversation will be created if no existing conversation with the participants specified with emails is found.
30
+
31
+ ## Examples
32
+
33
+ Send a message to a Microsoft Teams chat conversation by id
34
+
35
+ ```sh
36
+ m365 teams chat message send --chatId 19:2da4c29f6d7041eca70b638b43d45437@thread.v2
37
+ ```
38
+
39
+ Send a message to a single person
40
+
41
+ ```sh
42
+ m365 teams chat message send --userEmails alexw@contoso.com
43
+ ```
44
+
45
+ Send a message to a group of people
46
+
47
+ ```sh
48
+ m365 teams chat message send --userEmails alexw@contoso.com,meganb@contoso.com
49
+ ```
50
+
51
+ Send a message to a chat conversation finding it by display name
52
+
53
+ ```sh
54
+ m365 teams chat message send --chatName "Just a conversation"
55
+ ```