@pnp/cli-microsoft365 6.10.0 → 6.11.0-beta.6475e2e

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 (40) hide show
  1. package/dist/Command.js +1 -1
  2. package/dist/m365/cli/commands/config/config-list.js +29 -0
  3. package/dist/m365/cli/commands.js +1 -0
  4. package/dist/m365/pa/commands/app/app-permission-ensure.js +177 -0
  5. package/dist/m365/pa/commands/app/app-permission-remove.js +170 -0
  6. package/dist/m365/pa/commands.js +2 -0
  7. package/dist/m365/planner/commands/bucket/bucket-add.js +2 -2
  8. package/dist/m365/planner/commands/bucket/bucket-get.js +2 -2
  9. package/dist/m365/planner/commands/bucket/bucket-list.js +2 -2
  10. package/dist/m365/planner/commands/bucket/bucket-remove.js +2 -2
  11. package/dist/m365/planner/commands/bucket/bucket-set.js +2 -2
  12. package/dist/m365/planner/commands/plan/plan-get.js +1 -2
  13. package/dist/m365/planner/commands/plan/plan-list.js +4 -5
  14. package/dist/m365/planner/commands/plan/plan-set.js +2 -2
  15. package/dist/m365/spfx/commands/project/project-externalize/rules/PnPJsRule.js +34 -23
  16. package/dist/m365/spfx/commands/spfx-doctor.js +32 -48
  17. package/dist/m365/spo/commands/file/file-copy.js +38 -4
  18. package/dist/m365/spo/commands/group/group-list.js +0 -1
  19. package/dist/m365/spo/commands/navigation/navigation-node-set.js +2 -2
  20. package/dist/utils/planner.js +6 -3
  21. package/docs/docs/cmd/aad/user/user-set.mdx +1 -1
  22. package/docs/docs/cmd/cli/config/config-list.mdx +78 -0
  23. package/docs/docs/cmd/flow/flow-enable.mdx +2 -2
  24. package/docs/docs/cmd/login.mdx +6 -0
  25. package/docs/docs/cmd/pa/app/app-permission-ensure.mdx +85 -0
  26. package/docs/docs/cmd/pa/app/app-permission-remove.mdx +74 -0
  27. package/docs/docs/cmd/pp/dataverse/dataverse-table-get.mdx +2 -2
  28. package/docs/docs/cmd/pp/dataverse/dataverse-table-list.mdx +2 -2
  29. package/docs/docs/cmd/pp/dataverse/dataverse-table-remove.mdx +3 -3
  30. package/docs/docs/cmd/spo/file/file-copy.mdx +20 -10
  31. package/docs/docs/cmd/spo/listitem/listitem-attachment-list.mdx +1 -1
  32. package/docs/docs/cmd/spo/tenant/tenant-applicationcustomizer-add.mdx +1 -1
  33. package/docs/docs/cmd/spo/tenant/tenant-applicationcustomizer-list.mdx +1 -1
  34. package/docs/docs/cmd/spo/tenant/tenant-applicationcustomizer-remove.mdx +1 -1
  35. package/docs/docs/cmd/spo/tenant/tenant-commandset-add.mdx +1 -1
  36. package/docs/docs/cmd/spo/tenant/tenant-commandset-remove.mdx +1 -1
  37. package/docs/docs/cmd/spo/tenant/tenant-commandset-set.mdx +1 -1
  38. package/docs/docs/cmd/yammer/network/network-list.mdx +1 -1
  39. package/npm-shrinkwrap.json +2 -2
  40. package/package.json +2 -2
@@ -614,28 +614,22 @@ class SpfxDoctorCommand extends base_project_command_1.BaseProjectCommand {
614
614
  });
615
615
  }
616
616
  checkSharePointCompatibility(spfxVersion, prerequisites, args, fixes, logger) {
617
- return new Promise((resolve, reject) => {
617
+ return __awaiter(this, void 0, void 0, function* () {
618
618
  if (args.options.env) {
619
619
  const sp = this.spVersionStringToEnum(args.options.env);
620
620
  if ((prerequisites.sp & sp) === sp) {
621
621
  logger.log(formatting_1.formatting.getStatus(formatting_1.CheckStatus.Success, `Supported in ${SharePointVersion[sp]}`));
622
- resolve();
623
- }
624
- else {
625
- logger.log(formatting_1.formatting.getStatus(formatting_1.CheckStatus.Failure, `Not supported in ${SharePointVersion[sp]}`));
626
- fixes.push(`Use SharePoint Framework v${(sp === SharePointVersion.SP2016 ? '1.1' : '1.4.1')}`);
627
- reject(`SharePoint Framework v${spfxVersion} is not supported in ${SharePointVersion[sp]}`);
622
+ return;
628
623
  }
629
- }
630
- else {
631
- resolve();
624
+ logger.log(formatting_1.formatting.getStatus(formatting_1.CheckStatus.Failure, `Not supported in ${SharePointVersion[sp]}`));
625
+ fixes.push(`Use SharePoint Framework v${(sp === SharePointVersion.SP2016 ? '1.1' : '1.4.1')}`);
626
+ throw `SharePoint Framework v${spfxVersion} is not supported in ${SharePointVersion[sp]}`;
632
627
  }
633
628
  });
634
629
  }
635
630
  checkNodeVersion(prerequisites, fixes, logger) {
636
- return Promise
637
- .resolve(this.getNodeVersion())
638
- .then((nodeVersion) => {
631
+ return __awaiter(this, void 0, void 0, function* () {
632
+ const nodeVersion = this.getNodeVersion();
639
633
  this.checkStatus('Node', nodeVersion, prerequisites.node, OptionalOrRequired.Required, fixes, logger);
640
634
  });
641
635
  }
@@ -659,9 +653,8 @@ class SpfxDoctorCommand extends base_project_command_1.BaseProjectCommand {
659
653
  });
660
654
  }
661
655
  checkYo(prerequisites, fixes, logger) {
662
- return this
663
- .getPackageVersion('yo', PackageSearchMode.GlobalOnly, HandlePromise.Continue, logger)
664
- .then((yoVersion) => {
656
+ return __awaiter(this, void 0, void 0, function* () {
657
+ const yoVersion = yield this.getPackageVersion('yo', PackageSearchMode.GlobalOnly, HandlePromise.Continue, logger);
665
658
  if (yoVersion) {
666
659
  this.checkStatus('yo', yoVersion, prerequisites.yo, OptionalOrRequired.Required, fixes, logger);
667
660
  }
@@ -672,9 +665,8 @@ class SpfxDoctorCommand extends base_project_command_1.BaseProjectCommand {
672
665
  });
673
666
  }
674
667
  checkGulpCli(prerequisites, fixes, logger) {
675
- return this
676
- .getPackageVersion('gulp-cli', PackageSearchMode.GlobalOnly, HandlePromise.Continue, logger)
677
- .then((gulpCliVersion) => {
668
+ return __awaiter(this, void 0, void 0, function* () {
669
+ const gulpCliVersion = yield this.getPackageVersion('gulp-cli', PackageSearchMode.GlobalOnly, HandlePromise.Continue, logger);
678
670
  if (gulpCliVersion) {
679
671
  this.checkStatus('gulp-cli', gulpCliVersion, prerequisites.gulpCli, OptionalOrRequired.Required, fixes, logger);
680
672
  }
@@ -685,9 +677,8 @@ class SpfxDoctorCommand extends base_project_command_1.BaseProjectCommand {
685
677
  });
686
678
  }
687
679
  checkGulp(fixes, logger) {
688
- return this
689
- .getPackageVersion('gulp', PackageSearchMode.GlobalOnly, HandlePromise.Continue, logger)
690
- .then((gulpVersion) => {
680
+ return __awaiter(this, void 0, void 0, function* () {
681
+ const gulpVersion = yield this.getPackageVersion('gulp', PackageSearchMode.GlobalOnly, HandlePromise.Continue, logger);
691
682
  if (gulpVersion) {
692
683
  logger.log(formatting_1.formatting.getStatus(formatting_1.CheckStatus.Failure, `gulp should be removed`));
693
684
  fixes.push('npm un -g gulp');
@@ -695,9 +686,8 @@ class SpfxDoctorCommand extends base_project_command_1.BaseProjectCommand {
695
686
  });
696
687
  }
697
688
  checkTypeScript(fixes, logger) {
698
- return this
699
- .getPackageVersion('typescript', PackageSearchMode.LocalOnly, HandlePromise.Continue, logger)
700
- .then((typeScriptVersion) => {
689
+ return __awaiter(this, void 0, void 0, function* () {
690
+ const typeScriptVersion = yield this.getPackageVersion('typescript', PackageSearchMode.LocalOnly, HandlePromise.Continue, logger);
701
691
  if (typeScriptVersion) {
702
692
  logger.log(formatting_1.formatting.getStatus(formatting_1.CheckStatus.Failure, `typescript v${typeScriptVersion} installed in the project`));
703
693
  fixes.push('npm un typescript');
@@ -757,41 +747,35 @@ class SpfxDoctorCommand extends base_project_command_1.BaseProjectCommand {
757
747
  });
758
748
  }
759
749
  getPackageVersion(packageName, searchMode, handlePromise, logger) {
760
- return new Promise((resolve, reject) => {
750
+ return __awaiter(this, void 0, void 0, function* () {
761
751
  const args = ['ls', packageName, '--depth=0', '--json'];
762
752
  if (searchMode === PackageSearchMode.GlobalOnly) {
763
753
  args.push('-g');
764
754
  }
765
- this
766
- .getPackageVersionFromNpm(args, logger)
767
- .then((version) => {
768
- return Promise.resolve(version);
769
- })
770
- .catch(() => {
755
+ let version;
756
+ try {
757
+ version = yield this.getPackageVersionFromNpm(args, logger);
758
+ }
759
+ catch (_a) {
771
760
  if (searchMode === PackageSearchMode.LocalAndGlobal) {
772
761
  args.push('-g');
773
- return this.getPackageVersionFromNpm(args, logger);
762
+ version = yield this.getPackageVersionFromNpm(args, logger);
774
763
  }
775
764
  else {
776
- return Promise.resolve('');
765
+ version = '';
777
766
  }
778
- })
779
- .then((version) => {
780
- if (version) {
781
- resolve(version);
767
+ }
768
+ if (version) {
769
+ return version;
770
+ }
771
+ else {
772
+ if (handlePromise === HandlePromise.Continue) {
773
+ return '';
782
774
  }
783
775
  else {
784
- if (handlePromise === HandlePromise.Continue) {
785
- resolve('');
786
- }
787
- else {
788
- reject();
789
- }
776
+ throw new Error();
790
777
  }
791
- })
792
- .catch((err) => {
793
- reject(err);
794
- });
778
+ }
795
779
  });
796
780
  }
797
781
  getPackageVersionFromNpm(args, logger) {
@@ -13,7 +13,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
13
13
  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");
14
14
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
15
15
  };
16
- var _SpoFileCopyCommand_instances, _SpoFileCopyCommand_initTelemetry, _SpoFileCopyCommand_initOptions, _SpoFileCopyCommand_initValidators;
16
+ var _SpoFileCopyCommand_instances, _SpoFileCopyCommand_initTelemetry, _SpoFileCopyCommand_initOptions, _SpoFileCopyCommand_initValidators, _SpoFileCopyCommand_initOptionSets;
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
18
  const request_1 = require("../../../../request");
19
19
  const urlUtil_1 = require("../../../../utils/urlUtil");
@@ -34,11 +34,13 @@ class SpoFileCopyCommand extends SpoCommand_1.default {
34
34
  __classPrivateFieldGet(this, _SpoFileCopyCommand_instances, "m", _SpoFileCopyCommand_initTelemetry).call(this);
35
35
  __classPrivateFieldGet(this, _SpoFileCopyCommand_instances, "m", _SpoFileCopyCommand_initOptions).call(this);
36
36
  __classPrivateFieldGet(this, _SpoFileCopyCommand_instances, "m", _SpoFileCopyCommand_initValidators).call(this);
37
+ __classPrivateFieldGet(this, _SpoFileCopyCommand_instances, "m", _SpoFileCopyCommand_initOptionSets).call(this);
37
38
  }
38
39
  commandAction(logger, args) {
39
40
  return __awaiter(this, void 0, void 0, function* () {
40
41
  try {
41
- const sourcePath = this.getAbsoluteUrl(args.options.webUrl, urlUtil_1.urlUtil.getServerRelativePath(args.options.webUrl, args.options.sourceUrl));
42
+ const sourceServerRelativePath = yield this.getSourcePath(logger, args.options);
43
+ const sourcePath = this.getAbsoluteUrl(args.options.webUrl, sourceServerRelativePath);
42
44
  let destinationPath = this.getAbsoluteUrl(args.options.webUrl, args.options.targetUrl) + '/';
43
45
  if (args.options.newName) {
44
46
  destinationPath += args.options.newName;
@@ -66,6 +68,7 @@ class SpoFileCopyCommand extends SpoCommand_1.default {
66
68
  overwrite: args.options.nameConflictBehavior === 'replace',
67
69
  options: {
68
70
  KeepBoth: args.options.nameConflictBehavior === 'rename',
71
+ ResetAuthorAndCreatedOnCopy: !!args.options.resetAuthorAndCreated,
69
72
  ShouldBypassSharedLocks: !!args.options.bypassSharedLock
70
73
  }
71
74
  }
@@ -77,6 +80,25 @@ class SpoFileCopyCommand extends SpoCommand_1.default {
77
80
  }
78
81
  });
79
82
  }
83
+ getSourcePath(logger, options) {
84
+ return __awaiter(this, void 0, void 0, function* () {
85
+ if (options.sourceUrl) {
86
+ return urlUtil_1.urlUtil.getServerRelativePath(options.webUrl, options.sourceUrl);
87
+ }
88
+ if (this.verbose) {
89
+ logger.logToStderr(`Retrieving server-relative path for file with ID '${options.sourceId}'...`);
90
+ }
91
+ const requestOptions = {
92
+ url: `${options.webUrl}/_api/Web/GetFileById('${options.sourceId}')?$select=ServerRelativePath`,
93
+ headers: {
94
+ accept: 'application/json;odata=nometadata'
95
+ },
96
+ responseType: 'json'
97
+ };
98
+ const file = yield request_1.default.get(requestOptions);
99
+ return file.ServerRelativePath.DecodedUrl;
100
+ });
101
+ }
80
102
  getAbsoluteUrl(webUrl, url) {
81
103
  return url.startsWith('https://') ? url : urlUtil_1.urlUtil.getAbsoluteUrl(webUrl, url);
82
104
  }
@@ -84,8 +106,11 @@ class SpoFileCopyCommand extends SpoCommand_1.default {
84
106
  _SpoFileCopyCommand_instances = new WeakSet(), _SpoFileCopyCommand_initTelemetry = function _SpoFileCopyCommand_initTelemetry() {
85
107
  this.telemetry.push((args) => {
86
108
  Object.assign(this.telemetryProperties, {
109
+ sourceUrl: typeof args.options.sourceUrl !== 'undefined',
110
+ sourceId: typeof args.options.sourceId !== 'undefined',
87
111
  newName: typeof args.options.newName !== 'undefined',
88
112
  nameConflictBehavior: args.options.nameConflictBehavior || false,
113
+ resetAuthorAndCreated: !!args.options.resetAuthorAndCreated,
89
114
  bypassSharedLock: !!args.options.bypassSharedLock
90
115
  });
91
116
  });
@@ -93,7 +118,9 @@ _SpoFileCopyCommand_instances = new WeakSet(), _SpoFileCopyCommand_initTelemetry
93
118
  this.options.unshift({
94
119
  option: '-u, --webUrl <webUrl>'
95
120
  }, {
96
- option: '-s, --sourceUrl <sourceUrl>'
121
+ option: '-s, --sourceUrl [sourceUrl]'
122
+ }, {
123
+ option: '-i, --sourceId [sourceId]'
97
124
  }, {
98
125
  option: '-t, --targetUrl <targetUrl>'
99
126
  }, {
@@ -101,6 +128,8 @@ _SpoFileCopyCommand_instances = new WeakSet(), _SpoFileCopyCommand_initTelemetry
101
128
  }, {
102
129
  option: '--nameConflictBehavior [nameConflictBehavior]',
103
130
  autocomplete: this.nameConflictBehaviorOptions
131
+ }, {
132
+ option: '--resetAuthorAndCreated'
104
133
  }, {
105
134
  option: '--bypassSharedLock'
106
135
  });
@@ -110,11 +139,16 @@ _SpoFileCopyCommand_instances = new WeakSet(), _SpoFileCopyCommand_initTelemetry
110
139
  if (isValidSharePointUrl !== true) {
111
140
  return isValidSharePointUrl;
112
141
  }
142
+ if (args.options.sourceId && !validation_1.validation.isValidGuid(args.options.sourceId)) {
143
+ return `${args.options.sourceId} is not a valid GUID for sourceId.`;
144
+ }
113
145
  if (args.options.nameConflictBehavior && this.nameConflictBehaviorOptions.indexOf(args.options.nameConflictBehavior) === -1) {
114
- return `${args.options.nameConflictBehavior} is not a valid nameConflictBehavior value. Allowed values: ${this.nameConflictBehaviorOptions.join(', ')}`;
146
+ return `${args.options.nameConflictBehavior} is not a valid nameConflictBehavior value. Allowed values: ${this.nameConflictBehaviorOptions.join(', ')}.`;
115
147
  }
116
148
  return true;
117
149
  }));
150
+ }, _SpoFileCopyCommand_initOptionSets = function _SpoFileCopyCommand_initOptionSets() {
151
+ this.optionSets.push({ options: ['sourceUrl', 'sourceId'] });
118
152
  };
119
153
  module.exports = new SpoFileCopyCommand();
120
154
  //# sourceMappingURL=file-copy.js.map
@@ -73,7 +73,6 @@ class SpoGroupListCommand extends SpoCommand_1.default {
73
73
  responseType: 'json'
74
74
  };
75
75
  const groupProperties = yield request_1.default.get(requestOptions);
76
- logger.log(groupProperties);
77
76
  if (!options.output || !Cli_1.Cli.shouldTrimOutput(options.output)) {
78
77
  logger.log(groupProperties);
79
78
  }
@@ -132,8 +132,8 @@ _SpoNavigationNodeSetCommand_instances = new WeakSet(), _SpoNavigationNodeSetCom
132
132
  if (isValidSharePointUrl !== true) {
133
133
  return isValidSharePointUrl;
134
134
  }
135
- if (args.options.audienceIds === undefined && !args.options.url && args.options.isExternal === undefined && !args.options.title && args.options.openInNewWindow === undefined) {
136
- return `Please specify atleast one property to update.`;
135
+ if (args.options.audienceIds === undefined && args.options.url === undefined && args.options.isExternal === undefined && !args.options.title && args.options.openInNewWindow === undefined) {
136
+ return `Please specify at least one property to update.`;
137
137
  }
138
138
  if (args.options.audienceIds) {
139
139
  const audienceIdsSplitted = args.options.audienceIds.split(',');
@@ -45,11 +45,14 @@ exports.planner = {
45
45
  return odata_1.odata.getAllItems(`${graphResource}/v1.0/groups/${groupId}/planner/plans`, metadata);
46
46
  },
47
47
  /**
48
- * Get all Planner plans for a specific roster.
48
+ * Get the Planner plan for a specific Roster.
49
49
  * @param rosterId Roster ID.
50
50
  */
51
- getPlansByRosterId(rosterId, metadata = 'none') {
52
- return odata_1.odata.getAllItems(`${graphResource}/beta/planner/rosters/${rosterId}/plans`, metadata);
51
+ getPlanByRosterId(rosterId, metadata = 'none') {
52
+ return __awaiter(this, void 0, void 0, function* () {
53
+ const plans = yield odata_1.odata.getAllItems(`${graphResource}/beta/planner/rosters/${rosterId}/plans`, metadata);
54
+ return plans[0];
55
+ });
53
56
  },
54
57
  /**
55
58
  * Get Planner plan by title in a specific group.
@@ -87,7 +87,7 @@ If the user with the specified ID or username doesn't exist, or if the specified
87
87
  Update specific property _department_ of user with id _1caf7dcd-7e83-4c3a-94f7-932a1299c844_
88
88
 
89
89
  ```sh
90
- m365 aad user set --objectId 1caf7dcd-7e83-4c3a-94f7-932a1299c844 --Department IT
90
+ m365 aad user set --objectId 1caf7dcd-7e83-4c3a-94f7-932a1299c844 --department IT
91
91
  ```
92
92
 
93
93
  Update multiple properties of user by name
@@ -0,0 +1,78 @@
1
+ import CLISettings from '/docs/_clisettings.mdx';
2
+ import Global from '/docs/cmd/_global.mdx';
3
+ import Tabs from '@theme/Tabs';
4
+ import TabItem from '@theme/TabItem';
5
+
6
+ # cli config list
7
+
8
+ List all self set CLI for Microsoft 365 configurations
9
+
10
+ ## Usage
11
+
12
+ ```sh
13
+ m365 cli config list [options]
14
+ ```
15
+
16
+ ## Options
17
+
18
+ <Global />
19
+
20
+ ## Available settings
21
+
22
+ Following is the list of configuration settings available in CLI for Microsoft 365.
23
+
24
+ <CLISettings />
25
+
26
+ ## Examples
27
+
28
+ List all self set configuration keys with their value
29
+
30
+ ```sh
31
+ m365 cli config list
32
+ ```
33
+
34
+ ## Response
35
+
36
+ <Tabs>
37
+ <TabItem value="JSON">
38
+
39
+ ```json
40
+ {
41
+ "errorOutput": "stdout"
42
+ }
43
+ ```
44
+
45
+ </TabItem>
46
+ <TabItem value="Text">
47
+
48
+ ```text
49
+ errorOutput: stdout
50
+ ```
51
+
52
+ </TabItem>
53
+ <TabItem value="CSV">
54
+
55
+ ```csv
56
+ errorOutput
57
+ stdout
58
+ ```
59
+
60
+ </TabItem>
61
+ <TabItem value="Markdown">
62
+
63
+ ```md
64
+ # cli config list
65
+
66
+ Date: 29/6/2023
67
+
68
+ Property | Value
69
+ ---------|-------
70
+ errorOutput | stdout
71
+ ```
72
+
73
+ </TabItem>
74
+ </Tabs>
75
+
76
+ ## More information
77
+
78
+ - [Configuring the CLI for Microsoft 365](../../../user-guide/configuring-cli.mdx)
@@ -44,13 +44,13 @@ If the Power Automate flow with the name you specified doesn't exist, you will g
44
44
  Enables Power Automate flow owned by the currently signed-in user
45
45
 
46
46
  ```sh
47
- m365 flow enable --environment Default-d87a7535-dd31-4437-bfe1-95340acd55c5 --name 3989cb59-ce1a-4a5c-bb78-257c5c39381d
47
+ m365 flow enable --environmentName Default-d87a7535-dd31-4437-bfe1-95340acd55c5 --name 3989cb59-ce1a-4a5c-bb78-257c5c39381d
48
48
  ```
49
49
 
50
50
  Enables Power Automate flow owned by another user
51
51
 
52
52
  ```sh
53
- m365 flow enable --environment Default-d87a7535-dd31-4437-bfe1-95340acd55c5 --name 3989cb59-ce1a-4a5c-bb78-257c5c39381d --asAdmin
53
+ m365 flow enable --environmentName Default-d87a7535-dd31-4437-bfe1-95340acd55c5 --name 3989cb59-ce1a-4a5c-bb78-257c5c39381d --asAdmin
54
54
  ```
55
55
 
56
56
  ## Response
@@ -157,6 +157,12 @@ Log in to Microsoft 365 using your own Azure AD application that's restricted on
157
157
  m365 login --appId 31359c7f-bd7e-475c-86db-fdb8c937548c --tenant 31359c7f-bd7e-475c-86db-fdb8c937548a
158
158
  ```
159
159
 
160
+ Log in to Microsoft 365 using your own Azure AD application and a personal information exchange (.pfx) file
161
+
162
+ ```sh
163
+ m365 login --authType certificate --appId 31359c7f-bd7e-475c-86db-fdb8c937548c --tenant 31359c7f-bd7e-475c-86db-fdb8c937548a --certificateFile /Users/user/dev/localhost.pfx --password 'pass@word1'
164
+ ```
165
+
160
166
  Log in to Microsoft 365 using the interactive browser authentication. Uses the identity of the current user.
161
167
 
162
168
  ```sh
@@ -0,0 +1,85 @@
1
+ import Global from '/docs/cmd/_global.mdx';
2
+
3
+ # pa app permission ensure
4
+
5
+ Assigns/updates permissions to a Power Apps app
6
+
7
+ ## Usage
8
+
9
+ ```sh
10
+ m365 pa app permission ensure [options]
11
+ ```
12
+
13
+ ## Options
14
+
15
+ ```md definition-list
16
+ `--appName <appName>`
17
+ : The name (GUID) of the Microsoft Power App.
18
+
19
+ `--roleName <roleName>`
20
+ : Permission level given to the app. Valid values: `CanEdit`, `CanView`. Sharing with the entire tenant is only supported with `CanView` role.
21
+
22
+ `--userId [userId]`
23
+ : The Azure AD ID of the user. Specify either `userId`, `userName`, `groupId`, `groupName`, or `tenant`.
24
+
25
+ `--userName [userName]`
26
+ : The user principal name of the user. Specify either `userId`, `userName`, `groupId`, `groupName`, or `tenant`.
27
+
28
+ `--groupId [groupId]`
29
+ : The Azure AD ID of the group. Specify either `userId`, `userName`, `groupId`, `groupName`, or `tenant`.
30
+
31
+ `--groupName [groupName]`
32
+ : The name of the Azure AD group. Specify either `userId`, `userName`, `groupId`, `groupName`, or `tenant`.
33
+
34
+ `--tenant`
35
+ : Share the app with the entire tenant. When specifying this, only `CanView` role is supported. Specify either `userId`, `userName`, `groupId`, `groupName`, or `tenant`.
36
+
37
+ `--sendInvitationMail`
38
+ : When set, an invitation mail will be sent.
39
+
40
+ `--asAdmin`
41
+ : Run the command as admin for apps you don't own.
42
+
43
+ `-e, --environmentName [environmentName]`
44
+ : The name of the environment. Specify only a value when running the command as admin.
45
+ ```
46
+
47
+ <Global />
48
+
49
+ ## Remarks
50
+
51
+ :::note
52
+
53
+ When specifying a value for `groupId` or `groupName`, note that you can only grant permissions to security groups.
54
+
55
+ :::
56
+
57
+ ## Examples
58
+
59
+ Share a Power App app with another user with run-only permissions
60
+
61
+ ```sh
62
+ m365 pa app permission ensure --appName bc9f0a7e-53df-46af-b669-5888bb2f63d0 --userName john.doe@contoso.com --roleName CanView --sendInvitationMail
63
+ ```
64
+
65
+ Add co-owner permissions for a security group to a Power Apps app
66
+
67
+ ```sh
68
+ m365 pa app permission ensure --appName bc9f0a7e-53df-46af-b669-5888bb2f63d0 --groupName Developers --roleName CanEdit
69
+ ```
70
+
71
+ Add permissions as admin to a Power App app that you do not own
72
+
73
+ ```sh
74
+ m365 pa app permission ensure --environment Default-e535e809-c6a1-47b5-8951-d0898a64bf8a --appName bc9f0a7e-53df-46af-b669-5888bb2f63d0 --userId 42a28ec6-972f-4fdd-b483-50ee4b237f91 --roleName CanEdit --asAdmin
75
+ ```
76
+
77
+ Share a Power Apps app with everyone in the tenant
78
+
79
+ ```sh
80
+ m365 pa app permission ensure --appName bc9f0a7e-53df-46af-b669-5888bb2f63d0 --roleName CanView --tenant
81
+ ```
82
+
83
+ ## Response
84
+
85
+ The command won't return a response on success.
@@ -0,0 +1,74 @@
1
+ import Global from '/docs/cmd/_global.mdx';
2
+
3
+ # pa app permission remove
4
+
5
+ Removes permissions to a Power Apps app
6
+
7
+ ## Usage
8
+
9
+ ```sh
10
+ m365 pa app permission remove [options]
11
+ ```
12
+
13
+ ## Options
14
+
15
+ ```md definition-list
16
+ `--appName <appName>`
17
+ : The name (GUID) of the Microsoft Power App.
18
+
19
+ `--userId [userId]`
20
+ : The Azure AD ID of the user. Specify either `userId`, `userName`, `groupId`, `groupName`, or `tenant`.
21
+
22
+ `--userName [userName]`
23
+ : The user principal name of the user. Specify either `userId`, `userName`, `groupId`, `groupName`, or `tenant`.
24
+
25
+ `--groupId [groupId]`
26
+ : The Azure AD ID of the group. Specify either `userId`, `userName`, `groupId`, `groupName`, or `tenant`.
27
+
28
+ `--groupName [groupName]`
29
+ : The name of the Azure AD group. Specify either `userId`, `userName`, `groupId`, `groupName`, or `tenant`.
30
+
31
+ `--tenant`
32
+ : When specifying this, tenant permissions (everyone in the tenant) will be removed. Specify either `userId`, `userName`, `groupId`, `groupName`, or `tenant`.
33
+
34
+ `--asAdmin`
35
+ : Run the command as admin for apps you don't own.
36
+
37
+ `-e, --environmentName [environmentName]`
38
+ : The name of the environment. Specify only a value when running the command as admin.
39
+
40
+ `--confirm`
41
+ : Don't prompt for confirmation.
42
+ ```
43
+
44
+ <Global />
45
+
46
+ ## Examples
47
+
48
+ Remove permissions of a specific user for a specific app
49
+
50
+ ```sh
51
+ m365 pa app permission remove --appName bc9f0a7e-53df-46af-b669-5888bb2f63d0 --userName john.doe@contoso.com
52
+ ```
53
+
54
+ Remove permissions of a specific security group for a specific app
55
+
56
+ ```sh
57
+ m365 pa app permission remove --appName bc9f0a7e-53df-46af-b669-5888bb2f63d0 --groupName Developers
58
+ ```
59
+
60
+ Removes permissions as administrator for an app which you do not own
61
+
62
+ ```sh
63
+ m365 pa app permission remove --environment Default-e535e809-c6a1-47b5-8951-d0898a64bf8a --appName bc9f0a7e-53df-46af-b669-5888bb2f63d0 --userId 42a28ec6-972f-4fdd-b483-50ee4b237f91 --asAdmin
64
+ ```
65
+
66
+ Unshare a Power Apps app with the entire tenant
67
+
68
+ ```sh
69
+ m365 pa app permission remove --appName bc9f0a7e-53df-46af-b669-5888bb2f63d0 --tenant
70
+ ```
71
+
72
+ ## Response
73
+
74
+ The command won't return a response on success.
@@ -32,13 +32,13 @@ m365 pp dataverse table get [options]
32
32
  List a table for the given environment
33
33
 
34
34
  ```sh
35
- m365 pp dataverse table get -e "Default-2ca3eaa5-140f-4175-8261-3272edf9f339" --name "aaduser"
35
+ m365 pp dataverse table get --environment "Default-2ca3eaa5-140f-4175-8261-3272edf9f339" --name "aaduser"
36
36
  ```
37
37
 
38
38
  List a table for the given environment as Admin
39
39
 
40
40
  ```sh
41
- m365 pp dataverse table get -e "Default-2ca3eaa5-140f-4175-8261-3272edf9f339" --name "aaduser" --asAdmin
41
+ m365 pp dataverse table get --environment "Default-2ca3eaa5-140f-4175-8261-3272edf9f339" --name "aaduser" --asAdmin
42
42
  ```
43
43
 
44
44
  ## Response
@@ -29,13 +29,13 @@ m365 pp dataverse table list [options]
29
29
  List all tables for the given environment
30
30
 
31
31
  ```sh
32
- m365 pp dataverse table list -e "Default-2ca3eaa5-140f-4175-8261-3272edf9f339"
32
+ m365 pp dataverse table list --environment "Default-2ca3eaa5-140f-4175-8261-3272edf9f339"
33
33
  ```
34
34
 
35
35
  List all tables for the given environment as Admin
36
36
 
37
37
  ```sh
38
- m365 pp dataverse table list -e "Default-2ca3eaa5-140f-4175-8261-3272edf9f339" --asAdmin
38
+ m365 pp dataverse table list --environment "Default-2ca3eaa5-140f-4175-8261-3272edf9f339" --asAdmin
39
39
  ```
40
40
 
41
41
  ## Response
@@ -33,19 +33,19 @@ m365 pp dataverse table remove [options]
33
33
  Removes a dataverse table in a given environment
34
34
 
35
35
  ```sh
36
- m365 pp dataverse table remove -e "Default-2ca3eaa5-140f-4175-8261-3272edf9f339" --name "aaduser"
36
+ m365 pp dataverse table remove --environment "Default-2ca3eaa5-140f-4175-8261-3272edf9f339" --name "aaduser"
37
37
  ```
38
38
 
39
39
  Removes a dataverse table in a given environment as Admin
40
40
 
41
41
  ```sh
42
- m365 pp dataverse table remove -e "Default-2ca3eaa5-140f-4175-8261-3272edf9f339" --name "aaduser" --asAdmin
42
+ m365 pp dataverse table remove --environment "Default-2ca3eaa5-140f-4175-8261-3272edf9f339" --name "aaduser" --asAdmin
43
43
  ```
44
44
 
45
45
  Removes a dataverse table in a given environment without prompting for confirmation
46
46
 
47
47
  ```sh
48
- m365 pp dataverse table remove -e "Default-2ca3eaa5-140f-4175-8261-3272edf9f339" --name "aaduser" --confirm
48
+ m365 pp dataverse table remove --environment "Default-2ca3eaa5-140f-4175-8261-3272edf9f339" --name "aaduser" --confirm
49
49
  ```
50
50
 
51
51
  ## Response