@pnp/cli-microsoft365 7.0.0-beta.093ef31 → 7.0.0-beta.18ce559

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 (188) hide show
  1. package/README.md +4 -4
  2. package/dist/Auth.js +10 -1
  3. package/dist/Command.js +2 -2
  4. package/dist/cli/Cli.js +4 -4
  5. package/dist/m365/aad/commands/app/app-get.js +4 -1
  6. package/dist/m365/aad/commands/app/app-remove.js +3 -1
  7. package/dist/m365/aad/commands/app/app-role-add.js +4 -1
  8. package/dist/m365/aad/commands/app/app-role-list.js +4 -1
  9. package/dist/m365/aad/commands/app/app-role-remove.js +5 -2
  10. package/dist/m365/aad/commands/app/app-set.js +8 -5
  11. package/dist/m365/aad/commands/approleassignment/approleassignment-add.js +11 -6
  12. package/dist/m365/aad/commands/approleassignment/approleassignment-remove.js +4 -4
  13. package/dist/m365/aad/commands/group/group-get.js +4 -4
  14. package/dist/m365/aad/commands/group/group-list.js +1 -23
  15. package/dist/m365/aad/commands/group/group-remove.js +98 -0
  16. package/dist/m365/aad/commands/m365group/m365group-add.js +21 -12
  17. package/dist/m365/aad/commands/m365group/m365group-conversation-list.js +5 -0
  18. package/dist/m365/aad/commands/m365group/m365group-conversation-post-list.js +4 -0
  19. package/dist/m365/aad/commands/m365group/m365group-get.js +4 -3
  20. package/dist/m365/aad/commands/m365group/m365group-recyclebinitem-remove.js +3 -1
  21. package/dist/m365/aad/commands/m365group/m365group-recyclebinitem-restore.js +4 -1
  22. package/dist/m365/aad/commands/m365group/m365group-remove.js +5 -0
  23. package/dist/m365/aad/commands/m365group/m365group-renew.js +5 -0
  24. package/dist/m365/aad/commands/m365group/m365group-set.js +5 -0
  25. package/dist/m365/aad/commands/m365group/m365group-teamify.js +14 -6
  26. package/dist/m365/aad/commands/m365group/m365group-user-add.js +5 -0
  27. package/dist/m365/aad/commands/m365group/m365group-user-list.js +5 -0
  28. package/dist/m365/aad/commands/m365group/m365group-user-remove.js +5 -0
  29. package/dist/m365/aad/commands/m365group/m365group-user-set.js +5 -0
  30. package/dist/m365/aad/commands/sp/sp-add.js +4 -1
  31. package/dist/m365/aad/commands/sp/sp-get.js +4 -1
  32. package/dist/m365/aad/commands/user/user-get.js +7 -2
  33. package/dist/m365/aad/commands.js +1 -0
  34. package/dist/m365/booking/commands/business/business-get.js +4 -1
  35. package/dist/m365/commands/login.js +2 -2
  36. package/dist/m365/flow/commands/flow-export.js +13 -13
  37. package/dist/m365/graph/commands/subscription/subscription-add.js +5 -5
  38. package/dist/m365/outlook/commands/message/message-list.js +4 -2
  39. package/dist/m365/outlook/commands/message/message-move.js +4 -2
  40. package/dist/m365/pa/commands/app/app-export.js +7 -7
  41. package/dist/m365/pa/commands/connector/connector-export.js +5 -5
  42. package/dist/m365/planner/commands/bucket/bucket-add.js +4 -1
  43. package/dist/m365/planner/commands/bucket/bucket-get.js +9 -2
  44. package/dist/m365/planner/commands/bucket/bucket-list.js +4 -1
  45. package/dist/m365/planner/commands/bucket/bucket-remove.js +7 -2
  46. package/dist/m365/planner/commands/bucket/bucket-set.js +8 -2
  47. package/dist/m365/planner/commands/plan/plan-add.js +4 -1
  48. package/dist/m365/planner/commands/plan/plan-get.js +4 -1
  49. package/dist/m365/planner/commands/plan/plan-list.js +4 -1
  50. package/dist/m365/planner/commands/plan/plan-remove.js +4 -1
  51. package/dist/m365/planner/commands/plan/plan-set.js +4 -1
  52. package/dist/m365/planner/commands/roster/roster-get.js +4 -1
  53. package/dist/m365/planner/commands/roster/roster-member-add.js +4 -1
  54. package/dist/m365/planner/commands/roster/roster-member-get.js +4 -1
  55. package/dist/m365/planner/commands/roster/roster-member-list.js +4 -1
  56. package/dist/m365/planner/commands/roster/roster-member-remove.js +4 -1
  57. package/dist/m365/planner/commands/roster/roster-plan-list.js +4 -1
  58. package/dist/m365/planner/commands/roster/roster-remove.js +4 -1
  59. package/dist/m365/planner/commands/task/task-add.js +4 -1
  60. package/dist/m365/planner/commands/task/task-checklistitem-add.js +4 -1
  61. package/dist/m365/planner/commands/task/task-checklistitem-list.js +4 -1
  62. package/dist/m365/planner/commands/task/task-checklistitem-remove.js +4 -1
  63. package/dist/m365/planner/commands/task/task-get.js +11 -3
  64. package/dist/m365/planner/commands/task/task-list.js +10 -2
  65. package/dist/m365/planner/commands/task/task-reference-add.js +4 -1
  66. package/dist/m365/planner/commands/task/task-reference-list.js +4 -1
  67. package/dist/m365/planner/commands/task/task-reference-remove.js +4 -1
  68. package/dist/m365/planner/commands/task/task-remove.js +10 -4
  69. package/dist/m365/planner/commands/task/task-set.js +4 -1
  70. package/dist/m365/pp/commands/aibuildermodel/aibuildermodel-get.js +4 -1
  71. package/dist/m365/pp/commands/card/card-get.js +3 -5
  72. package/dist/m365/pp/commands/chatbot/chatbot-get.js +3 -1
  73. package/dist/m365/pp/commands/chatbot/chatbot-list.js +2 -2
  74. package/dist/m365/pp/commands/managementapp/managementapp-add.js +4 -1
  75. package/dist/m365/search/commands/externalconnection/externalconnection-remove.js +3 -1
  76. package/dist/m365/spfx/commands/project/project-doctor/{doctor-1.18.0-beta.5.js → doctor-1.18.0.js} +2 -2
  77. package/dist/m365/spfx/commands/project/project-doctor.js +1 -1
  78. package/dist/m365/spfx/commands/project/project-upgrade/rules/FN001022_DEP_office_ui_fabric_react.js +1 -1
  79. package/dist/m365/spfx/commands/project/project-upgrade/rules/FN002028_DEVDEP_microsoft_rush_stack_compiler_4_7.js +13 -0
  80. package/dist/m365/spfx/commands/project/project-upgrade/{upgrade-1.18.0-beta.5.js → upgrade-1.18.0.js} +35 -27
  81. package/dist/m365/spfx/commands/project/project-upgrade.js +13 -15
  82. package/dist/m365/spfx/commands/spfx-doctor.js +3 -3
  83. package/dist/m365/spo/commands/applicationcustomizer/applicationcustomizer-get.js +5 -3
  84. package/dist/m365/spo/commands/applicationcustomizer/applicationcustomizer-remove.js +2 -2
  85. package/dist/m365/spo/commands/applicationcustomizer/applicationcustomizer-set.js +3 -2
  86. package/dist/m365/spo/commands/commandset/commandset-get.js +4 -2
  87. package/dist/m365/spo/commands/commandset/commandset-remove.js +2 -1
  88. package/dist/m365/spo/commands/commandset/commandset-set.js +3 -1
  89. package/dist/m365/spo/commands/customaction/customaction-get.js +5 -2
  90. package/dist/m365/spo/commands/customaction/customaction-remove.js +3 -1
  91. package/dist/m365/spo/commands/eventreceiver/eventreceiver-get.js +3 -1
  92. package/dist/m365/spo/commands/file/file-get.js +11 -8
  93. package/dist/m365/spo/commands/file/file-remove.js +2 -2
  94. package/dist/m365/spo/commands/file/file-version-clear.js +2 -2
  95. package/dist/m365/spo/commands/file/file-version-get.js +2 -2
  96. package/dist/m365/spo/commands/file/file-version-list.js +2 -2
  97. package/dist/m365/spo/commands/file/file-version-remove.js +2 -2
  98. package/dist/m365/spo/commands/file/file-version-restore.js +2 -2
  99. package/dist/m365/spo/commands/group/group-member-add.js +24 -24
  100. package/dist/m365/spo/commands/hubsite/hubsite-connect.js +7 -4
  101. package/dist/m365/spo/commands/hubsite/hubsite-disconnect.js +4 -1
  102. package/dist/m365/spo/commands/hubsite/hubsite-get.js +3 -1
  103. package/dist/m365/spo/commands/listitem/listitem-add.js +1 -0
  104. package/dist/m365/spo/commands/listitem/listitem-attachment-add.js +127 -0
  105. package/dist/m365/spo/commands/listitem/listitem-attachment-get.js +97 -0
  106. package/dist/m365/spo/commands/listitem/listitem-attachment-remove.js +121 -0
  107. package/dist/m365/spo/commands/listitem/listitem-attachment-set.js +115 -0
  108. package/dist/m365/spo/commands/listitem/listitem-set.js +3 -2
  109. package/dist/m365/spo/commands/page/clientsidepages.js +18 -0
  110. package/dist/m365/spo/commands/page/page-get.js +1 -0
  111. package/dist/m365/spo/commands/page/page-list.js +4 -3
  112. package/dist/m365/spo/commands/page/page-section-add.js +56 -21
  113. package/dist/m365/spo/commands/page/page-set.js +13 -2
  114. package/dist/m365/spo/commands/site/site-commsite-enable.js +34 -5
  115. package/dist/m365/spo/commands/site/site-list.js +5 -7
  116. package/dist/m365/spo/commands/tenant/tenant-appcatalog-add.js +1 -1
  117. package/dist/m365/spo/commands/tenant/tenant-applicationcustomizer-get.js +8 -3
  118. package/dist/m365/spo/commands/tenant/tenant-applicationcustomizer-list.js +3 -2
  119. package/dist/m365/spo/commands/tenant/tenant-applicationcustomizer-remove.js +2 -1
  120. package/dist/m365/spo/commands/tenant/tenant-applicationcustomizer-set.js +3 -2
  121. package/dist/m365/spo/commands/tenant/tenant-commandset-get.js +8 -3
  122. package/dist/m365/spo/commands/tenant/tenant-commandset-list.js +3 -2
  123. package/dist/m365/spo/commands/tenant/tenant-commandset-remove.js +3 -1
  124. package/dist/m365/spo/commands/term/term-get.js +6 -6
  125. package/dist/m365/spo/commands/user/user-get.js +10 -10
  126. package/dist/m365/spo/commands.js +4 -0
  127. package/dist/m365/teams/commands/app/app-remove.js +49 -15
  128. package/dist/m365/teams/commands/channel/channel-add.js +5 -1
  129. package/dist/m365/teams/commands/channel/channel-member-add.js +12 -10
  130. package/dist/m365/teams/commands/channel/channel-member-remove.js +3 -1
  131. package/dist/m365/teams/commands/channel/channel-member-set.js +4 -1
  132. package/dist/m365/teams/commands/chat/chat-get.js +7 -10
  133. package/dist/m365/teams/commands/chat/chat-message-send.js +8 -10
  134. package/dist/m365/teams/commands/team/team-clone.js +5 -10
  135. package/dist/m365/teams/commands/team/team-list.js +94 -30
  136. package/dist/m365/tenant/commands/info/info-get.js +83 -0
  137. package/dist/m365/tenant/commands.js +1 -0
  138. package/dist/utils/aadGroup.js +21 -3
  139. package/dist/utils/formatting.js +7 -0
  140. package/dist/utils/powerPlatform.js +1 -1
  141. package/docs/docs/_clisettings.mdx +1 -1
  142. package/docs/docs/cmd/aad/app/app-set.mdx +15 -15
  143. package/docs/docs/cmd/aad/approleassignment/approleassignment-add.mdx +9 -9
  144. package/docs/docs/cmd/aad/approleassignment/approleassignment-remove.mdx +10 -10
  145. package/docs/docs/cmd/aad/group/group-get.mdx +5 -5
  146. package/docs/docs/cmd/aad/group/group-list.mdx +0 -11
  147. package/docs/docs/cmd/aad/group/group-remove.mdx +44 -0
  148. package/docs/docs/cmd/aad/m365group/m365group-add.mdx +13 -3
  149. package/docs/docs/cmd/aad/policy/policy-list.mdx +5 -5
  150. package/docs/docs/cmd/cli/config/config-list.mdx +1 -1
  151. package/docs/docs/cmd/flow/flow-export.mdx +11 -11
  152. package/docs/docs/cmd/graph/subscription/subscription-add.mdx +10 -10
  153. package/docs/docs/cmd/pa/app/app-export.mdx +5 -5
  154. package/docs/docs/cmd/pa/connector/connector-export.mdx +3 -3
  155. package/docs/docs/cmd/pp/chatbot/chatbot-list.mdx +4 -4
  156. package/docs/docs/cmd/pp/solution/solution-publisher-get.mdx +2 -2
  157. package/docs/docs/cmd/pp/solution/solution-publisher-remove.mdx +2 -2
  158. package/docs/docs/cmd/spfx/project/project-upgrade.mdx +1 -1
  159. package/docs/docs/cmd/spo/file/file-get.mdx +2 -2
  160. package/docs/docs/cmd/spo/file/file-remove.mdx +2 -2
  161. package/docs/docs/cmd/spo/file/file-version-clear.mdx +2 -2
  162. package/docs/docs/cmd/spo/file/file-version-get.mdx +2 -2
  163. package/docs/docs/cmd/spo/file/file-version-list.mdx +2 -2
  164. package/docs/docs/cmd/spo/file/file-version-remove.mdx +2 -2
  165. package/docs/docs/cmd/spo/file/file-version-restore.mdx +2 -2
  166. package/docs/docs/cmd/spo/group/group-member-add.mdx +27 -27
  167. package/docs/docs/cmd/spo/list/list-contenttype-remove.mdx +1 -1
  168. package/docs/docs/cmd/spo/listitem/listitem-add.mdx +2 -5
  169. package/docs/docs/cmd/spo/listitem/listitem-attachment-add.mdx +110 -0
  170. package/docs/docs/cmd/spo/listitem/listitem-attachment-get.mdx +104 -0
  171. package/docs/docs/cmd/spo/listitem/listitem-attachment-remove.mdx +58 -0
  172. package/docs/docs/cmd/spo/listitem/listitem-attachment-set.mdx +58 -0
  173. package/docs/docs/cmd/spo/listitem/listitem-set.mdx +2 -5
  174. package/docs/docs/cmd/spo/page/page-get.mdx +0 -1
  175. package/docs/docs/cmd/spo/page/page-list.mdx +0 -1
  176. package/docs/docs/cmd/spo/page/page-section-add.mdx +25 -1
  177. package/docs/docs/cmd/spo/page/page-set.mdx +23 -0
  178. package/docs/docs/cmd/spo/site/site-commsite-enable.mdx +11 -2
  179. package/docs/docs/cmd/spo/tenant/tenant-applicationcustomizer-list.mdx +2 -4
  180. package/docs/docs/cmd/spo/tenant/tenant-commandset-list.mdx +2 -4
  181. package/docs/docs/cmd/spo/user/user-get.mdx +8 -8
  182. package/docs/docs/cmd/teams/app/app-remove.mdx +9 -6
  183. package/docs/docs/cmd/teams/channel/channel-member-add.mdx +4 -4
  184. package/docs/docs/cmd/teams/team/team-clone.mdx +3 -3
  185. package/docs/docs/cmd/teams/team/team-list.mdx +47 -22
  186. package/docs/docs/cmd/tenant/info/info-get.mdx +101 -0
  187. package/npm-shrinkwrap.json +24 -24
  188. package/package.json +8 -12
@@ -4,7 +4,6 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
4
4
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
5
5
  };
6
6
  var _TeamsChatMessageSendCommand_instances, _TeamsChatMessageSendCommand_initTelemetry, _TeamsChatMessageSendCommand_initOptions, _TeamsChatMessageSendCommand_initValidators, _TeamsChatMessageSendCommand_initOptionSets;
7
- import os from 'os';
8
7
  import auth from '../../../../Auth.js';
9
8
  import request from '../../../../request.js';
10
9
  import { accessToken } from '../../../../utils/accessToken.js';
@@ -12,6 +11,8 @@ import { validation } from '../../../../utils/validation.js';
12
11
  import GraphCommand from '../../../base/GraphCommand.js';
13
12
  import commands from '../../commands.js';
14
13
  import { chatUtil } from './chatUtil.js';
14
+ import { Cli } from '../../../../cli/Cli.js';
15
+ import { formatting } from '../../../../utils/formatting.js';
15
16
  class TeamsChatMessageSendCommand extends GraphCommand {
16
17
  get name() {
17
18
  return commands.CHAT_MESSAGE_SEND;
@@ -55,10 +56,9 @@ class TeamsChatMessageSendCommand extends GraphCommand {
55
56
  if (existingChats.length === 1) {
56
57
  return existingChats[0].id;
57
58
  }
58
- const disambiguationText = existingChats.map(c => {
59
- return `- ${c.id}${c.topic && ' - '}${c.topic} - ${c.createdDateTime && new Date(c.createdDateTime).toLocaleString()}`;
60
- }).join(os.EOL);
61
- throw `Multiple chat conversations with this name found. Please disambiguate:${os.EOL}${disambiguationText}`;
59
+ const resultAsKeyValuePair = formatting.convertArrayToHashTable('id', existingChats);
60
+ const result = await Cli.handleMultipleResultsFound(`Multiple chat conversations with this name found.`, resultAsKeyValuePair);
61
+ return result.id;
62
62
  }
63
63
  async getChatIdByName(chatName) {
64
64
  const existingChats = await chatUtil.findExistingGroupChatsByName(chatName);
@@ -68,11 +68,9 @@ class TeamsChatMessageSendCommand extends GraphCommand {
68
68
  if (existingChats.length === 1) {
69
69
  return existingChats[0].id;
70
70
  }
71
- const disambiguationText = existingChats.map(c => {
72
- const memberstring = c.members.map(m => m.email).join(', ');
73
- return `- ${c.id} - ${c.createdDateTime && new Date(c.createdDateTime).toLocaleString()} - ${memberstring}`;
74
- }).join(os.EOL);
75
- throw `Multiple chat conversations with this name found. Please disambiguate:${os.EOL}${disambiguationText}`;
71
+ const resultAsKeyValuePair = formatting.convertArrayToHashTable('id', existingChats);
72
+ const result = await Cli.handleMultipleResultsFound(`Multiple chat conversations with this name found.`, resultAsKeyValuePair);
73
+ return result.id;
76
74
  }
77
75
  // This Microsoft Graph API request throws an intermittent 404 exception, saying that it cannot find the principal.
78
76
  // The same behavior occurs when creating the conversation through the Graph Explorer.
@@ -3,7 +3,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
3
3
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
4
4
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
5
5
  };
6
- var _TeamsTeamCloneCommand_instances, _TeamsTeamCloneCommand_initTelemetry, _TeamsTeamCloneCommand_initOptions, _TeamsTeamCloneCommand_initValidators, _TeamsTeamCloneCommand_initOptionSets;
6
+ var _TeamsTeamCloneCommand_instances, _TeamsTeamCloneCommand_initTelemetry, _TeamsTeamCloneCommand_initOptions, _TeamsTeamCloneCommand_initValidators;
7
7
  import request from '../../../../request.js';
8
8
  import { formatting } from '../../../../utils/formatting.js';
9
9
  import { validation } from '../../../../utils/validation.js';
@@ -22,7 +22,6 @@ class TeamsTeamCloneCommand extends GraphCommand {
22
22
  __classPrivateFieldGet(this, _TeamsTeamCloneCommand_instances, "m", _TeamsTeamCloneCommand_initTelemetry).call(this);
23
23
  __classPrivateFieldGet(this, _TeamsTeamCloneCommand_instances, "m", _TeamsTeamCloneCommand_initOptions).call(this);
24
24
  __classPrivateFieldGet(this, _TeamsTeamCloneCommand_instances, "m", _TeamsTeamCloneCommand_initValidators).call(this);
25
- __classPrivateFieldGet(this, _TeamsTeamCloneCommand_instances, "m", _TeamsTeamCloneCommand_initOptionSets).call(this);
26
25
  }
27
26
  async commandAction(logger, args) {
28
27
  const data = {
@@ -42,7 +41,7 @@ class TeamsTeamCloneCommand extends GraphCommand {
42
41
  const requestOptions = {
43
42
  url: `${this.resource}/v1.0/teams/${formatting.encodeQueryParameter(args.options.id)}/clone`,
44
43
  headers: {
45
- "content-type": "application/json",
44
+ 'content-type': 'application/json',
46
45
  accept: 'application/json;odata.metadata=none'
47
46
  },
48
47
  responseType: 'json',
@@ -75,16 +74,14 @@ _TeamsTeamCloneCommand_instances = new WeakSet(), _TeamsTeamCloneCommand_initTel
75
74
  Object.assign(this.telemetryProperties, {
76
75
  description: typeof args.options.description !== 'undefined',
77
76
  classification: typeof args.options.classification !== 'undefined',
78
- visibility: typeof args.options.visibility !== 'undefined',
79
- id: typeof args.options.id !== 'undefined',
80
- name: typeof args.options.name !== 'undefined'
77
+ visibility: typeof args.options.visibility !== 'undefined'
81
78
  });
82
79
  });
83
80
  }, _TeamsTeamCloneCommand_initOptions = function _TeamsTeamCloneCommand_initOptions() {
84
81
  this.options.unshift({
85
- option: '-i, --id [id]'
82
+ option: '-i, --id <id>'
86
83
  }, {
87
- option: '-n, --name [name]'
84
+ option: '-n, --name <name>'
88
85
  }, {
89
86
  option: '-p, --partsToClone <partsToClone>',
90
87
  autocomplete: ['apps', 'channels', 'members', 'settings', 'tabs']
@@ -121,8 +118,6 @@ _TeamsTeamCloneCommand_instances = new WeakSet(), _TeamsTeamCloneCommand_initTel
121
118
  }
122
119
  return true;
123
120
  });
124
- }, _TeamsTeamCloneCommand_initOptionSets = function _TeamsTeamCloneCommand_initOptionSets() {
125
- this.optionSets.push({ options: ['id', 'name'] });
126
121
  };
127
122
  export default new TeamsTeamCloneCommand();
128
123
  //# sourceMappingURL=team-clone.js.map
@@ -3,11 +3,13 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
3
3
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
4
4
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
5
5
  };
6
- var _TeamsTeamListCommand_instances, _TeamsTeamListCommand_initTelemetry, _TeamsTeamListCommand_initOptions;
6
+ var _TeamsTeamListCommand_instances, _TeamsTeamListCommand_initTelemetry, _TeamsTeamListCommand_initOptions, _TeamsTeamListCommand_initValidators, _TeamsTeamListCommand_initOptionSets, _TeamsTeamListCommand_initTypes;
7
7
  import request from '../../../../request.js';
8
8
  import { odata } from '../../../../utils/odata.js';
9
9
  import GraphCommand from '../../../base/GraphCommand.js';
10
10
  import commands from '../../commands.js';
11
+ import { validation } from '../../../../utils/validation.js';
12
+ import { formatting } from '../../../../utils/formatting.js';
11
13
  class TeamsTeamListCommand extends GraphCommand {
12
14
  get name() {
13
15
  return commands.TEAM_LIST;
@@ -23,64 +25,126 @@ class TeamsTeamListCommand extends GraphCommand {
23
25
  _TeamsTeamListCommand_instances.add(this);
24
26
  __classPrivateFieldGet(this, _TeamsTeamListCommand_instances, "m", _TeamsTeamListCommand_initTelemetry).call(this);
25
27
  __classPrivateFieldGet(this, _TeamsTeamListCommand_instances, "m", _TeamsTeamListCommand_initOptions).call(this);
28
+ __classPrivateFieldGet(this, _TeamsTeamListCommand_instances, "m", _TeamsTeamListCommand_initValidators).call(this);
29
+ __classPrivateFieldGet(this, _TeamsTeamListCommand_instances, "m", _TeamsTeamListCommand_initOptionSets).call(this);
30
+ __classPrivateFieldGet(this, _TeamsTeamListCommand_instances, "m", _TeamsTeamListCommand_initTypes).call(this);
26
31
  }
27
32
  async commandAction(logger, args) {
28
- let endpoint = `${this.resource}/v1.0/groups?$select=id,displayName,description,resourceProvisioningOptions`;
29
- if (args.options.joined) {
30
- endpoint = `${this.resource}/v1.0/me/joinedTeams`;
33
+ if (this.verbose) {
34
+ if (!args.options.joined && !args.options.associated) {
35
+ await logger.logToStderr(`Retrieving Microsoft Teams in the tenant...`);
36
+ }
37
+ else {
38
+ const user = args.options.userId || args.options.userName || 'me';
39
+ await logger.logToStderr(`Retrieving Microsoft Teams ${args.options.joined ? 'joined by' : 'associated with'} ${user}...`);
40
+ }
31
41
  }
32
42
  try {
33
- const items = await odata.getAllItems(endpoint);
34
- if (args.options.joined) {
35
- await logger.log(items);
43
+ let endpoint = `${this.resource}/v1.0`;
44
+ if (args.options.joined || args.options.associated) {
45
+ endpoint += args.options.userId || args.options.userName ? `/users/${args.options.userId || formatting.encodeQueryParameter(args.options.userName)}` : '/me';
46
+ endpoint += args.options.joined ? '/joinedTeams' : '/teamwork/associatedTeams';
47
+ endpoint += '?$select=id';
36
48
  }
37
49
  else {
38
- const teamItems = await Promise.all(items.filter((e) => {
39
- return e.resourceProvisioningOptions.indexOf('Team') > -1;
40
- }).map(g => this.getTeamFromGroup(g)));
41
- await logger.log(teamItems);
50
+ // Get all team groups within the tenant
51
+ endpoint += `/groups?$select=id&$filter=resourceProvisioningOptions/Any(x:x eq 'Team')`;
42
52
  }
53
+ const groupResponse = await odata.getAllItems(endpoint);
54
+ const groupIds = groupResponse.map(g => g.id);
55
+ if (this.verbose) {
56
+ await logger.logToStderr(`Retrieved ${groupIds.length} Microsoft Teams, getting additional information...`);
57
+ }
58
+ let teams = await this.getAllTeams(groupIds);
59
+ // Sort teams by display name
60
+ teams = teams.sort((x, y) => x.displayName.localeCompare(y.displayName));
61
+ await logger.log(teams);
43
62
  }
44
63
  catch (err) {
45
64
  this.handleRejectedODataJsonPromise(err);
46
65
  }
47
66
  }
48
- async getTeamFromGroup(group) {
67
+ async getAllTeams(groupIds) {
68
+ const groupBatches = [];
69
+ for (let i = 0; groupIds.length > i; i += 20) {
70
+ groupBatches.push(groupIds.slice(i, i + 20));
71
+ }
72
+ const promises = groupBatches.map(g => this.getTeamsBatch(g));
73
+ const teams = await Promise.all(promises);
74
+ const result = teams.reduce((prev, val) => prev.concat(val), []);
75
+ return result;
76
+ }
77
+ async getTeamsBatch(groupIds) {
49
78
  const requestOptions = {
50
- url: `${this.resource}/v1.0/teams/${group.id}`,
79
+ url: `${this.resource}/v1.0/$batch`,
51
80
  headers: {
52
- accept: 'application/json;odata.metadata=none'
81
+ accept: 'application/json;odata.metadata=none',
82
+ 'content-type': 'application/json'
53
83
  },
54
- responseType: 'json'
55
- };
56
- try {
57
- return await request.get(requestOptions);
58
- }
59
- catch (err) {
60
- if (err.statusCode === 403) {
61
- return {
62
- id: group.id,
63
- displayName: group.displayName,
64
- description: group.description,
65
- isArchived: undefined
66
- };
84
+ responseType: 'json',
85
+ data: {
86
+ requests: groupIds.map((id, index) => ({
87
+ id: index.toString(),
88
+ method: 'GET',
89
+ headers: {
90
+ accept: 'application/json;odata.metadata=none'
91
+ },
92
+ url: `/teams/${id}`
93
+ }))
67
94
  }
68
- else {
69
- throw err;
95
+ };
96
+ const response = await request.post(requestOptions);
97
+ // Throw error if any of the requests failed
98
+ for (const item of response.responses) {
99
+ if (item.status !== 200) {
100
+ throw item.body;
70
101
  }
71
102
  }
103
+ return response.responses.map(r => r.body);
72
104
  }
73
105
  }
74
106
  _TeamsTeamListCommand_instances = new WeakSet(), _TeamsTeamListCommand_initTelemetry = function _TeamsTeamListCommand_initTelemetry() {
75
107
  this.telemetry.push((args) => {
76
108
  Object.assign(this.telemetryProperties, {
77
- joined: args.options.joined
109
+ joined: !!args.options.joined,
110
+ associated: !!args.options.associated,
111
+ userId: typeof args.options.userId !== 'undefined',
112
+ userName: typeof args.options.userName !== 'undefined'
78
113
  });
79
114
  });
80
115
  }, _TeamsTeamListCommand_initOptions = function _TeamsTeamListCommand_initOptions() {
81
116
  this.options.unshift({
82
117
  option: '-j, --joined'
118
+ }, {
119
+ option: '-a, --associated'
120
+ }, {
121
+ option: '--userId [userId]'
122
+ }, {
123
+ option: '--userName [userName]'
124
+ });
125
+ }, _TeamsTeamListCommand_initValidators = function _TeamsTeamListCommand_initValidators() {
126
+ this.validators.push(async (args) => {
127
+ if (args.options.userId && !validation.isValidGuid(args.options.userId)) {
128
+ return `${args.options.userId} is not a valid GUID for userId.`;
129
+ }
130
+ if (args.options.userName && !validation.isValidUserPrincipalName(args.options.userName)) {
131
+ return `${args.options.userId} is not a valid UPN for userName.`;
132
+ }
133
+ if ((args.options.userId || args.options.userName) && !args.options.joined && !args.options.associated) {
134
+ return 'You must specify either joined or associated when specifying userId or userName.';
135
+ }
136
+ return true;
137
+ });
138
+ }, _TeamsTeamListCommand_initOptionSets = function _TeamsTeamListCommand_initOptionSets() {
139
+ this.optionSets.push({
140
+ options: ['joined', 'associated'],
141
+ runsWhen: (args) => !!args.options.joined || !!args.options.associated
142
+ }, {
143
+ options: ['userId', 'userName'],
144
+ runsWhen: (args) => typeof args.options.userId !== 'undefined' || typeof args.options.userName !== 'undefined'
83
145
  });
146
+ }, _TeamsTeamListCommand_initTypes = function _TeamsTeamListCommand_initTypes() {
147
+ this.types.string.push('userId', 'userName');
84
148
  };
85
149
  export default new TeamsTeamListCommand();
86
150
  //# sourceMappingURL=team-list.js.map
@@ -0,0 +1,83 @@
1
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
2
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
3
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
4
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
5
+ };
6
+ var _TenantInfoGetCommand_instances, _TenantInfoGetCommand_initTelemetry, _TenantInfoGetCommand_initOptions, _TenantInfoGetCommand_initValidators;
7
+ import auth from '../../../../Auth.js';
8
+ import GraphCommand from '../../../base/GraphCommand.js';
9
+ import request from '../../../../request.js';
10
+ import { accessToken } from '../../../../utils/accessToken.js';
11
+ import { formatting } from '../../../../utils/formatting.js';
12
+ import { validation } from '../../../../utils/validation.js';
13
+ import commands from '../../commands.js';
14
+ class TenantInfoGetCommand extends GraphCommand {
15
+ get name() {
16
+ return commands.INFO_GET;
17
+ }
18
+ get description() {
19
+ return 'Gets information about any tenant';
20
+ }
21
+ constructor() {
22
+ super();
23
+ _TenantInfoGetCommand_instances.add(this);
24
+ __classPrivateFieldGet(this, _TenantInfoGetCommand_instances, "m", _TenantInfoGetCommand_initTelemetry).call(this);
25
+ __classPrivateFieldGet(this, _TenantInfoGetCommand_instances, "m", _TenantInfoGetCommand_initOptions).call(this);
26
+ __classPrivateFieldGet(this, _TenantInfoGetCommand_instances, "m", _TenantInfoGetCommand_initValidators).call(this);
27
+ }
28
+ async commandAction(logger, args) {
29
+ let domainName = args.options.domainName;
30
+ const tenantId = args.options.tenantId;
31
+ if (!domainName && !tenantId) {
32
+ const userName = accessToken.getUserNameFromAccessToken(auth.service.accessTokens[auth.defaultResource].accessToken);
33
+ domainName = userName.split('@')[1];
34
+ }
35
+ let requestUrl = `${this.resource}/v1.0/tenantRelationships/`;
36
+ if (tenantId) {
37
+ requestUrl += `findTenantInformationByTenantId(tenantId='${formatting.encodeQueryParameter(tenantId)}')`;
38
+ }
39
+ else {
40
+ requestUrl += `findTenantInformationByDomainName(domainName='${formatting.encodeQueryParameter(domainName)}')`;
41
+ }
42
+ const requestOptions = {
43
+ url: requestUrl,
44
+ headers: {
45
+ accept: 'application/json;odata.metadata=none'
46
+ },
47
+ responseType: 'json'
48
+ };
49
+ try {
50
+ const res = await request.get(requestOptions);
51
+ await logger.log(res);
52
+ }
53
+ catch (err) {
54
+ this.handleRejectedODataJsonPromise(err);
55
+ }
56
+ }
57
+ }
58
+ _TenantInfoGetCommand_instances = new WeakSet(), _TenantInfoGetCommand_initTelemetry = function _TenantInfoGetCommand_initTelemetry() {
59
+ this.telemetry.push((args) => {
60
+ Object.assign(this.telemetryProperties, {
61
+ domainName: typeof args.options.domainName !== 'undefined',
62
+ tenantId: typeof args.options.tenantId !== 'undefined'
63
+ });
64
+ });
65
+ }, _TenantInfoGetCommand_initOptions = function _TenantInfoGetCommand_initOptions() {
66
+ this.options.unshift({
67
+ option: '-d, --domainName [domainName]'
68
+ }, {
69
+ option: '-i, --tenantId [tenantId]'
70
+ });
71
+ }, _TenantInfoGetCommand_initValidators = function _TenantInfoGetCommand_initValidators() {
72
+ this.validators.push(async (args) => {
73
+ if (args.options.tenantId && !validation.isValidGuid(args.options.tenantId)) {
74
+ return `${args.options.tenantId} is not a valid GUID`;
75
+ }
76
+ if (args.options.tenantId && args.options.domainName) {
77
+ return `Specify either domainName or tenantId but not both`;
78
+ }
79
+ return true;
80
+ });
81
+ };
82
+ export default new TenantInfoGetCommand();
83
+ //# sourceMappingURL=info-get.js.map
@@ -1,6 +1,7 @@
1
1
  const prefix = 'tenant';
2
2
  export default {
3
3
  ID_GET: `${prefix} id get`,
4
+ INFO_GET: `${prefix} info get`,
4
5
  REPORT_ACTIVEUSERCOUNTS: `${prefix} report activeusercounts`,
5
6
  REPORT_ACTIVEUSERDETAIL: `${prefix} report activeuserdetail`,
6
7
  REPORT_OFFICE365ACTIVATIONCOUNTS: `${prefix} report office365activationcounts`,
@@ -1,13 +1,14 @@
1
1
  import request from "../request.js";
2
2
  import { formatting } from "./formatting.js";
3
3
  import { odata } from "./odata.js";
4
+ import { Cli } from '../cli/Cli.js';
4
5
  const graphResource = 'https://graph.microsoft.com';
5
6
  export const aadGroup = {
6
7
  /**
7
8
  * Retrieve a single group.
8
9
  * @param id Group ID.
9
10
  */
10
- getGroupById(id) {
11
+ async getGroupById(id) {
11
12
  const requestOptions = {
12
13
  url: `${graphResource}/v1.0/groups/${id}`,
13
14
  headers: {
@@ -21,7 +22,7 @@ export const aadGroup = {
21
22
  * Get a list of groups by display name.
22
23
  * @param displayName Group display name.
23
24
  */
24
- getGroupsByDisplayName(displayName) {
25
+ async getGroupsByDisplayName(displayName) {
25
26
  return odata.getAllItems(`${graphResource}/v1.0/groups?$filter=displayName eq '${formatting.encodeQueryParameter(displayName)}'`);
26
27
  },
27
28
  /**
@@ -36,7 +37,8 @@ export const aadGroup = {
36
37
  throw Error(`The specified group '${displayName}' does not exist.`);
37
38
  }
38
39
  if (groups.length > 1) {
39
- throw Error(`Multiple groups with name '${displayName}' found: ${groups.map(x => x.id).join(',')}.`);
40
+ const resultAsKeyValuePair = formatting.convertArrayToHashTable('id', groups);
41
+ return await Cli.handleMultipleResultsFound(`Multiple groups with name '${displayName}' found.`, resultAsKeyValuePair);
40
42
  }
41
43
  return groups[0];
42
44
  },
@@ -73,6 +75,22 @@ export const aadGroup = {
73
75
  data: update
74
76
  };
75
77
  await request.patch(requestOptions);
78
+ },
79
+ /**
80
+ * Checks if group is a m365 group.
81
+ * @param groupId Group id.
82
+ * @returns whether the group is a m365 group or not
83
+ */
84
+ async isUnifiedGroup(groupId) {
85
+ const requestOptions = {
86
+ url: `${graphResource}/v1.0/groups/${groupId}?$select=groupTypes`,
87
+ headers: {
88
+ accept: 'application/json;odata.metadata=none'
89
+ },
90
+ responseType: 'json'
91
+ };
92
+ const group = await request.get(requestOptions);
93
+ return group.groupTypes.some(type => type === 'Unified');
76
94
  }
77
95
  };
78
96
  //# sourceMappingURL=aadGroup.js.map
@@ -153,6 +153,13 @@ export const formatting = {
153
153
  const success = primarySupported ? '✔' : '√';
154
154
  const failure = primarySupported ? '✖' : '×';
155
155
  return `${result === CheckStatus.Success ? chalk.green(success) : chalk.red(failure)} ${message}`;
156
+ },
157
+ convertArrayToHashTable(key, array) {
158
+ const resultAsKeyValuePair = {};
159
+ array.forEach((obj) => {
160
+ resultAsKeyValuePair[obj[key]] = obj;
161
+ });
162
+ return resultAsKeyValuePair;
156
163
  }
157
164
  };
158
165
  //# sourceMappingURL=formatting.js.map
@@ -19,7 +19,7 @@ export const powerPlatform = {
19
19
  };
20
20
  try {
21
21
  const response = await request.get(requestOptions);
22
- return Promise.resolve(response.properties.linkedEnvironmentMetadata.instanceApiUrl);
22
+ return response.properties.linkedEnvironmentMetadata.instanceApiUrl;
23
23
  }
24
24
  catch (ex) {
25
25
  throw Error(`The environment '${environment}' could not be retrieved. See the inner exception for more details: ${ex.message}`);
@@ -12,6 +12,6 @@ Setting name|Definition|Default value
12
12
  `helpMode`|Defines what part of command's help to display. Allowed values are `options`, `examples`, `remarks`, `response`, `full`|`options`
13
13
  `output`|Defines the default output when issuing a command. Allowed values are `json`, `text`, `csv`, `md`, `none`|`json`
14
14
  `printErrorsAsPlainText`|When output mode is set to `json`, print error messages as plain-text rather than JSON|`true`
15
- `prompt`|Prompts for missing values in required options and enables interactive selection when multiple values are available for a command that requires a specific value to be retrieved.|`false`
15
+ `prompt`|Prompts for missing values in required options and enables interactive selection when multiple values are available for a command that requires a specific value to be retrieved.|`true`
16
16
  `showHelpOnFailure`|Automatically display help when executing a command failed|`true`
17
17
  `showSpinner`|Display spinner when executing commands|`true`
@@ -14,34 +14,34 @@ m365 aad app set [options]
14
14
 
15
15
  ```md definition-list
16
16
  `--appId [appId]`
17
- : Application (client) ID of the Azure AD application registration to update. Specify either `appId`, `objectId` or `name`
17
+ : Application (client) ID of the Azure AD application registration to update. Specify either `appId`, `objectId` or `name`.
18
18
 
19
19
  `--objectId [objectId]`
20
- : Object ID of the Azure AD application registration to update. Specify either `appId`, `objectId` or `name`
20
+ : Object ID of the Azure AD application registration to update. Specify either `appId`, `objectId` or `name`.
21
21
 
22
22
  `--name [name]`
23
- : Name of the Azure AD application registration to update. Specify either `appId`, `objectId` or `name`
23
+ : Name of the Azure AD application registration to update. Specify either `appId`, `objectId` or `name`.
24
24
 
25
- `-u, --uri [uri]`
26
- : Comma-separated list of Application ID URIs to update
25
+ `-u, --uris [uris]`
26
+ : Comma-separated list of Application ID URIs to update.
27
27
 
28
28
  `-r, --redirectUris [redirectUris]`
29
- : Comma-separated list of redirect URIs to add to the app registration. Requires `platform` to be specified
29
+ : Comma-separated list of redirect URIs to add to the app registration. Requires `platform` to be specified.
30
30
 
31
31
  `-p, --platform [platform]`
32
- : Platform for which the `redirectUri` should be configured. Allowed values `spa`, `web`, `publicClient`
32
+ : Platform for which the `redirectUri` should be configured. Allowed values `spa`, `web`, `publicClient`.
33
33
 
34
34
  `--redirectUrisToRemove [redirectUrisToRemove]`
35
- : Comma-separated list of existing redirect URIs to remove. Specify, when you want to replace existing redirect URIs with another
35
+ : Comma-separated list of existing redirect URIs to remove. Specify, when you want to replace existing redirect URIs with another.
36
36
 
37
37
  `--certificateFile [certificateFile]`
38
- : Path to the file with certificate public key. Specify either `certificateFile` or `certificateBase64Encoded`
38
+ : Path to the file with certificate public key. Specify either `certificateFile` or `certificateBase64Encoded`.
39
39
 
40
40
  `--certificateBase64Encoded [certificateBase64Encoded]`
41
- : Base64-encoded string with certificate public key. Specify either `certificateFile` or `certificateBase64Encoded`
41
+ : Base64-encoded string with certificate public key. Specify either `certificateFile` or `certificateBase64Encoded`.
42
42
 
43
43
  `--certificateDisplayName [certificateDisplayName]`
44
- : Display name for the certificate. If not given, the displayName will be set to the certificate subject. When specified, also specify either `certificateFile` or `certificateBase64Encoded`
44
+ : Display name for the certificate. If not given, the displayName will be set to the certificate subject. When specified, also specify either `certificateFile` or `certificateBase64Encoded`.
45
45
  ```
46
46
 
47
47
  <Global />
@@ -59,19 +59,19 @@ When a certificate is specified it will be added to the list of certificates of
59
59
  Update the app URI of the Azure AD application registration specified by its object ID
60
60
 
61
61
  ```sh
62
- m365 aad app set --objectId d75be2e1-0204-4f95-857d-51a37cf40be8 --uri https://contoso.com/e75be2e1-0204-4f95-857d-51a37cf40be8
62
+ m365 aad app set --objectId d75be2e1-0204-4f95-857d-51a37cf40be8 --uris https://contoso.com/e75be2e1-0204-4f95-857d-51a37cf40be8
63
63
  ```
64
64
 
65
65
  Update the app URI of the Azure AD application registration specified by its app (client) ID
66
66
 
67
67
  ```sh
68
- m365 aad app set --appId e75be2e1-0204-4f95-857d-51a37cf40be8 --uri https://contoso.com/e75be2e1-0204-4f95-857d-51a37cf40be8
68
+ m365 aad app set --appId e75be2e1-0204-4f95-857d-51a37cf40be8 --uris https://contoso.com/e75be2e1-0204-4f95-857d-51a37cf40be8
69
69
  ```
70
70
 
71
71
  Update the app URI of the Azure AD application registration specified by its name
72
72
 
73
73
  ```sh
74
- m365 aad app set --name "My app" --uri https://contoso.com/e75be2e1-0204-4f95-857d-51a37cf40be8
74
+ m365 aad app set --name "My app" --uris https://contoso.com/e75be2e1-0204-4f95-857d-51a37cf40be8
75
75
  ```
76
76
 
77
77
  Add a new redirect URI for SPA authentication
@@ -94,4 +94,4 @@ m365 aad app set --appId e75be2e1-0204-4f95-857d-51a37cf40be8 --certificateDispl
94
94
 
95
95
  ## Response
96
96
 
97
- The command won't return a response on success.
97
+ The command won't return a response on success.
@@ -16,19 +16,19 @@ m365 aad approleassignment add [options]
16
16
 
17
17
  ```md definition-list
18
18
  `--appId [appId]`
19
- : Application appId also known as clientId of the App Registration to which the configured scopes (app roles) should be applied
19
+ : Application appId also known as clientId of the App Registration to which the configured scopes (app roles) should be applied.
20
20
 
21
21
  `--appObjectId [appObjectId]`
22
- : Application objectId of the App Registration to which the configured scopes (app roles) should be applied
22
+ : Application objectId of the App Registration to which the configured scopes (app roles) should be applied.
23
23
 
24
24
  `--appDisplayName [appDisplayName]`
25
- : Application name of the App Registration to which the configured scopes (app roles) should be applied
25
+ : Application name of the App Registration to which the configured scopes (app roles) should be applied.
26
26
 
27
27
  `-r, --resource <resource>`
28
28
  : Service principal name, appId or objectId that has the scopes (roles) e.g. `SharePoint`.
29
29
 
30
- `-s, --scope <scope>`
31
- : Permissions known also as scopes and roles to grant the application with. If multiple permissions have to be granted, they have to be comma-separated e.g. `Sites.Read.All`, `Sites.ReadWrite.all`
30
+ `-s, --scopes <scopes>`
31
+ : Permissions known also as scopes and roles to grant the application with. If multiple permissions have to be granted, they have to be comma-separated e.g. `Sites.Read.All`, `Sites.ReadWrite.all`.
32
32
  ```
33
33
 
34
34
  <Global />
@@ -48,19 +48,19 @@ This command can also be used to assign permissions to system or user-assigned m
48
48
  Adds SharePoint _Sites.Read.All_ application permissions to Azure AD application with app id _57907bf8-73fa-43a6-89a5-1f603e29e451_
49
49
 
50
50
  ```sh
51
- m365 aad approleassignment add --appId "57907bf8-73fa-43a6-89a5-1f603e29e451" --resource "SharePoint" --scope "Sites.Read.All"
51
+ m365 aad approleassignment add --appId "57907bf8-73fa-43a6-89a5-1f603e29e451" --resource "SharePoint" --scopes "Sites.Read.All"
52
52
  ```
53
53
 
54
54
  Adds multiple Microsoft Graph application permissions to an Azure AD application with the name _MyAppName__
55
55
 
56
56
  ```sh
57
- m365 aad approleassignment add --appDisplayName "MyAppName" --resource "Microsoft Graph" --scope "Mail.Read,Mail.Send"
57
+ m365 aad approleassignment add --appDisplayName "MyAppName" --resource "Microsoft Graph" --scopes "Mail.Read,Mail.Send"
58
58
  ```
59
59
 
60
60
  Adds Microsoft Graph _Mail.Read_ application permissions to a system-managed identity app with objectId _57907bf8-73fa-43a6-89a5-1f603e29e451_
61
61
 
62
62
  ```sh
63
- m365 aad approleassignment add --appObjectId "57907bf8-73fa-43a6-89a5-1f603e29e451" --resource "Microsoft Graph" --scope "Mail.Read"
63
+ m365 aad approleassignment add --appObjectId "57907bf8-73fa-43a6-89a5-1f603e29e451" --resource "Microsoft Graph" --scopes "Mail.Read"
64
64
  ```
65
65
 
66
66
  ## Response
@@ -106,7 +106,7 @@ m365 aad approleassignment add --appObjectId "57907bf8-73fa-43a6-89a5-1f603e29e4
106
106
  <TabItem value="Markdown">
107
107
 
108
108
  ```md
109
- # aad approleassignment add --appId "e89804ac-a571-48cf-b2ba-fd57b5d49993" --resource "Microsoft Graph" --scope "Mail.Read"
109
+ # aad approleassignment add --appId "e89804ac-a571-48cf-b2ba-fd57b5d49993" --resource "Microsoft Graph" --scopes "Mail.Read"
110
110
 
111
111
  Date: 2023-06-01
112
112
 
@@ -14,22 +14,22 @@ m365 aad approleassignment remove [options]
14
14
 
15
15
  ```md definition-list
16
16
  `--appId [appId]`
17
- : Application appId also known as clientId of the App Registration for which the configured scopes (app roles) should be deleted
17
+ : Application appId also known as clientId of the App Registration for which the configured scopes (app roles) should be deleted.
18
18
 
19
19
  `--appObjectId [appObjectId]`
20
- : Application objectId of the App Registration for which the configured scopes (app roles) should be deleted
20
+ : Application objectId of the App Registration for which the configured scopes (app roles) should be deleted.
21
21
 
22
22
  `--appDisplayName [appDisplayName]`
23
- : Application name of the App Registration for which the configured scopes (app roles) should be deleted
23
+ : Application name of the App Registration for which the configured scopes (app roles) should be deleted.
24
24
 
25
25
  `-r, --resource <resource>`
26
- : Service principal name, appId or objectId that has the scopes (roles) e.g. `SharePoint`
26
+ : Service principal name, appId or objectId that has the scopes (roles) e.g. `SharePoint`.
27
27
 
28
- `-s, --scope <scope>`
29
- : Permissions known also as scopes and roles to be deleted from the application. If multiple permissions have to be deleted, they have to be comma-separated e.g. `Sites.Read.All`,`Sites.ReadWrite.All`
28
+ `-s, --scopes <scopes>`
29
+ : Permissions known also as scopes and roles to be deleted from the application. If multiple permissions have to be deleted, they have to be comma-separated e.g. `Sites.Read.All`,`Sites.ReadWrite.All`.
30
30
 
31
31
  `-f, --force`
32
- : Don't prompt for confirming removing the all role assignment
32
+ : Don't prompt for confirming removing the all role assignment.
33
33
  ```
34
34
 
35
35
  <Global />
@@ -49,19 +49,19 @@ This command can also be used to assign permissions to system- or user-assigned
49
49
  Deletes SharePoint _Sites.Read.All_ application permissions from Azure AD application with app id _57907bf8-73fa-43a6-89a5-1f603e29e451_
50
50
 
51
51
  ```sh
52
- m365 aad approleassignment remove --appId "57907bf8-73fa-43a6-89a5-1f603e29e451" --resource "SharePoint" --scope "Sites.Read.All"
52
+ m365 aad approleassignment remove --appId "57907bf8-73fa-43a6-89a5-1f603e29e451" --resource "SharePoint" --scopes "Sites.Read.All"
53
53
  ```
54
54
 
55
55
  Deletes multiple Microsoft Graph application permissions from an Azure AD application with name _MyAppName_
56
56
 
57
57
  ```sh
58
- m365 aad approleassignment remove --appDisplayName "MyAppName" --resource "Microsoft Graph" --scope "Mail.Read,Mail.Send"
58
+ m365 aad approleassignment remove --appDisplayName "MyAppName" --resource "Microsoft Graph" --scopes "Mail.Read,Mail.Send"
59
59
  ```
60
60
 
61
61
  Deletes Microsoft Graph _Mail.Read_ application permissions from a system-managed identity app with objectId _57907bf8-73fa-43a6-89a5-1f603e29e451_
62
62
 
63
63
  ```sh
64
- m365 aad approleassignment remove --appObjectId "57907bf8-73fa-43a6-89a5-1f603e29e451" --resource "Microsoft Graph" --scope "Mail.Read"
64
+ m365 aad approleassignment remove --appObjectId "57907bf8-73fa-43a6-89a5-1f603e29e451" --resource "Microsoft Graph" --scopes "Mail.Read"
65
65
  ```
66
66
 
67
67
  ## Response