@pnp/cli-microsoft365 7.3.0-beta.e0b37b9 → 7.4.0-beta.ae3d33b
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.
- package/allCommands.json +1 -1
- package/allCommandsFull.json +1 -1
- package/dist/Auth.js +3 -0
- package/dist/m365/aad/commands/administrativeunit/administrativeunit-member-get.js +112 -0
- package/dist/m365/aad/commands.js +1 -0
- package/dist/m365/base/PowerAutomateCommand.js +18 -0
- package/dist/m365/external/commands/connection/connection-schema-add.js +36 -3
- package/dist/m365/flow/commands/environment/environment-get.js +3 -3
- package/dist/m365/flow/commands/environment/environment-list.js +3 -3
- package/dist/m365/flow/commands/flow-disable.js +3 -3
- package/dist/m365/flow/commands/flow-enable.js +3 -3
- package/dist/m365/flow/commands/flow-get.js +3 -3
- package/dist/m365/flow/commands/flow-list.js +14 -12
- package/dist/m365/flow/commands/flow-remove.js +3 -3
- package/dist/m365/flow/commands/owner/owner-ensure.js +3 -3
- package/dist/m365/flow/commands/owner/owner-list.js +3 -3
- package/dist/m365/flow/commands/owner/owner-remove.js +3 -3
- package/dist/m365/flow/commands/run/run-cancel.js +3 -3
- package/dist/m365/flow/commands/run/run-get.js +3 -3
- package/dist/m365/flow/commands/run/run-list.js +8 -7
- package/dist/m365/flow/commands/run/run-resubmit.js +4 -4
- package/dist/m365/pa/commands/app/app-get.js +26 -11
- package/dist/m365/pa/commands/app/app-remove.js +19 -2
- package/dist/m365/spo/commands/listitem/listitem-batch-add.js +18 -7
- package/dist/m365/spo/commands/page/page-add.js +7 -28
- package/dist/utils/aadAdministrativeUnit.js +4 -4
- package/docs/docs/cmd/aad/administrativeunit/administrativeunit-member-get.mdx +130 -0
- package/docs/docs/cmd/external/connection/connection-schema-add.mdx +14 -1
- package/docs/docs/cmd/pa/app/app-get.mdx +15 -0
- package/docs/docs/cmd/pa/app/app-remove.mdx +14 -0
- package/docs/docs/cmd/spo/listitem/listitem-batch-add.mdx +25 -3
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
|
@@ -32,8 +32,13 @@ class PaAppGetCommand extends PowerAppsCommand {
|
|
|
32
32
|
async commandAction(logger, args) {
|
|
33
33
|
try {
|
|
34
34
|
if (args.options.name) {
|
|
35
|
+
let endpoint = `${this.resource}/providers/Microsoft.PowerApps`;
|
|
36
|
+
if (args.options.asAdmin) {
|
|
37
|
+
endpoint += `/scopes/admin/environments/${formatting.encodeQueryParameter(args.options.environmentName)}`;
|
|
38
|
+
}
|
|
39
|
+
endpoint += `/apps/${formatting.encodeQueryParameter(args.options.name)}?api-version=2016-11-01`;
|
|
35
40
|
const requestOptions = {
|
|
36
|
-
url:
|
|
41
|
+
url: endpoint,
|
|
37
42
|
headers: {
|
|
38
43
|
accept: 'application/json'
|
|
39
44
|
},
|
|
@@ -50,8 +55,8 @@ class PaAppGetCommand extends PowerAppsCommand {
|
|
|
50
55
|
await logger.logToStderr(`Retrieving information about Microsoft Power App with displayName '${args.options.displayName}'...`);
|
|
51
56
|
}
|
|
52
57
|
const getAppsOutput = await this.getApps(args, logger);
|
|
53
|
-
|
|
54
|
-
|
|
58
|
+
if (getAppsOutput.stdout && JSON.parse(getAppsOutput.stdout).length > 0) {
|
|
59
|
+
const allApps = JSON.parse(getAppsOutput.stdout);
|
|
55
60
|
const app = allApps.find((a) => {
|
|
56
61
|
return a.properties.displayName.toLowerCase() === `${args.options.displayName}`.toLowerCase();
|
|
57
62
|
});
|
|
@@ -59,15 +64,11 @@ class PaAppGetCommand extends PowerAppsCommand {
|
|
|
59
64
|
await logger.log(this.setProperties(app));
|
|
60
65
|
}
|
|
61
66
|
else {
|
|
62
|
-
|
|
63
|
-
await logger.logToStderr(`No app found with displayName '${args.options.displayName}'`);
|
|
64
|
-
}
|
|
67
|
+
throw `No app found with displayName '${args.options.displayName}'.`;
|
|
65
68
|
}
|
|
66
69
|
}
|
|
67
70
|
else {
|
|
68
|
-
|
|
69
|
-
await logger.logToStderr('No apps found');
|
|
70
|
-
}
|
|
71
|
+
throw 'No apps found.';
|
|
71
72
|
}
|
|
72
73
|
}
|
|
73
74
|
}
|
|
@@ -82,7 +83,9 @@ class PaAppGetCommand extends PowerAppsCommand {
|
|
|
82
83
|
const options = {
|
|
83
84
|
output: 'json',
|
|
84
85
|
debug: this.debug,
|
|
85
|
-
verbose: this.verbose
|
|
86
|
+
verbose: this.verbose,
|
|
87
|
+
environmentName: args.options.environmentName,
|
|
88
|
+
asAdmin: args.options.asAdmin
|
|
86
89
|
};
|
|
87
90
|
return await cli.executeCommandWithOutput(paAppListCommand, { options: { ...options, _: [] } });
|
|
88
91
|
}
|
|
@@ -98,7 +101,9 @@ _PaAppGetCommand_instances = new WeakSet(), _PaAppGetCommand_initTelemetry = fun
|
|
|
98
101
|
this.telemetry.push((args) => {
|
|
99
102
|
Object.assign(this.telemetryProperties, {
|
|
100
103
|
name: typeof args.options.name !== 'undefined',
|
|
101
|
-
displayName: typeof args.options.displayName !== 'undefined'
|
|
104
|
+
displayName: typeof args.options.displayName !== 'undefined',
|
|
105
|
+
asAdmin: !!args.options.asAdmin,
|
|
106
|
+
environmentName: typeof args.options.environmentName !== 'undefined'
|
|
102
107
|
});
|
|
103
108
|
});
|
|
104
109
|
}, _PaAppGetCommand_initOptions = function _PaAppGetCommand_initOptions() {
|
|
@@ -106,12 +111,22 @@ _PaAppGetCommand_instances = new WeakSet(), _PaAppGetCommand_initTelemetry = fun
|
|
|
106
111
|
option: '-n, --name [name]'
|
|
107
112
|
}, {
|
|
108
113
|
option: '-d, --displayName [displayName]'
|
|
114
|
+
}, {
|
|
115
|
+
option: '-e, --environmentName [environmentName]'
|
|
116
|
+
}, {
|
|
117
|
+
option: '--asAdmin'
|
|
109
118
|
});
|
|
110
119
|
}, _PaAppGetCommand_initValidators = function _PaAppGetCommand_initValidators() {
|
|
111
120
|
this.validators.push(async (args) => {
|
|
112
121
|
if (args.options.name && !validation.isValidGuid(args.options.name)) {
|
|
113
122
|
return `${args.options.name} is not a valid GUID`;
|
|
114
123
|
}
|
|
124
|
+
if (args.options.asAdmin && !args.options.environmentName) {
|
|
125
|
+
return 'When specifying the asAdmin option, the environment option is required as well.';
|
|
126
|
+
}
|
|
127
|
+
if (args.options.environmentName && !args.options.asAdmin) {
|
|
128
|
+
return 'When specifying the environment option, the asAdmin option is required as well.';
|
|
129
|
+
}
|
|
115
130
|
return true;
|
|
116
131
|
});
|
|
117
132
|
}, _PaAppGetCommand_initOptionSets = function _PaAppGetCommand_initOptionSets() {
|
|
@@ -30,8 +30,13 @@ class PaAppRemoveCommand extends PowerAppsCommand {
|
|
|
30
30
|
await logger.logToStderr(`Removing Microsoft Power App ${args.options.name}...`);
|
|
31
31
|
}
|
|
32
32
|
const removePaApp = async () => {
|
|
33
|
+
let endpoint = `${this.resource}/providers/Microsoft.PowerApps`;
|
|
34
|
+
if (args.options.asAdmin) {
|
|
35
|
+
endpoint += `/scopes/admin/environments/${formatting.encodeQueryParameter(args.options.environmentName)}`;
|
|
36
|
+
}
|
|
37
|
+
endpoint += `/apps/${formatting.encodeQueryParameter(args.options.name)}?api-version=2017-08-01`;
|
|
33
38
|
const requestOptions = {
|
|
34
|
-
url:
|
|
39
|
+
url: endpoint,
|
|
35
40
|
fullResponse: true,
|
|
36
41
|
headers: {
|
|
37
42
|
accept: 'application/json'
|
|
@@ -64,7 +69,9 @@ class PaAppRemoveCommand extends PowerAppsCommand {
|
|
|
64
69
|
_PaAppRemoveCommand_instances = new WeakSet(), _PaAppRemoveCommand_initTelemetry = function _PaAppRemoveCommand_initTelemetry() {
|
|
65
70
|
this.telemetry.push((args) => {
|
|
66
71
|
Object.assign(this.telemetryProperties, {
|
|
67
|
-
force: typeof args.options.force !== 'undefined'
|
|
72
|
+
force: typeof args.options.force !== 'undefined',
|
|
73
|
+
asAdmin: !!args.options.asAdmin,
|
|
74
|
+
environmentName: typeof args.options.environmentName !== 'undefined'
|
|
68
75
|
});
|
|
69
76
|
});
|
|
70
77
|
}, _PaAppRemoveCommand_initOptions = function _PaAppRemoveCommand_initOptions() {
|
|
@@ -72,12 +79,22 @@ _PaAppRemoveCommand_instances = new WeakSet(), _PaAppRemoveCommand_initTelemetry
|
|
|
72
79
|
option: '-n, --name <name>'
|
|
73
80
|
}, {
|
|
74
81
|
option: '-f, --force'
|
|
82
|
+
}, {
|
|
83
|
+
option: '--asAdmin'
|
|
84
|
+
}, {
|
|
85
|
+
option: '-e, --environmentName [environmentName]'
|
|
75
86
|
});
|
|
76
87
|
}, _PaAppRemoveCommand_initValidators = function _PaAppRemoveCommand_initValidators() {
|
|
77
88
|
this.validators.push(async (args) => {
|
|
78
89
|
if (!validation.isValidGuid(args.options.name)) {
|
|
79
90
|
return `${args.options.name} is not a valid GUID`;
|
|
80
91
|
}
|
|
92
|
+
if (args.options.asAdmin && !args.options.environmentName) {
|
|
93
|
+
return 'When specifying the asAdmin option, the environment option is required as well.';
|
|
94
|
+
}
|
|
95
|
+
if (args.options.environmentName && !args.options.asAdmin) {
|
|
96
|
+
return 'When specifying the environment option, the asAdmin option is required as well.';
|
|
97
|
+
}
|
|
81
98
|
return true;
|
|
82
99
|
});
|
|
83
100
|
};
|
|
@@ -35,9 +35,9 @@ class SpoListItemBatchAddCommand extends SpoCommand {
|
|
|
35
35
|
async commandAction(logger, args) {
|
|
36
36
|
try {
|
|
37
37
|
if (this.verbose) {
|
|
38
|
-
await logger.logToStderr(`Starting to create batch items from csv at path ${args.options.filePath}`);
|
|
38
|
+
await logger.logToStderr(`Starting to create batch items from csv ${args.options.filePath ? `at path ${args.options.filePath}` : 'from content'}`);
|
|
39
39
|
}
|
|
40
|
-
const csvContent = fs.readFileSync(args.options.filePath, 'utf8');
|
|
40
|
+
const csvContent = args.options.filePath ? fs.readFileSync(args.options.filePath, 'utf8') : args.options.csvContent;
|
|
41
41
|
const jsonContent = formatting.parseCsvToJson(csvContent);
|
|
42
42
|
await this.addItemsAsBatch(jsonContent, args.options, logger);
|
|
43
43
|
}
|
|
@@ -97,7 +97,7 @@ class SpoListItemBatchAddCommand extends SpoCommand {
|
|
|
97
97
|
batchBody.push(`Accept: application/json;odata=nometadata\n`);
|
|
98
98
|
batchBody.push(`Content-Type: application/json;odata=verbose\n`);
|
|
99
99
|
batchBody.push(`If-Match: *\n\n`);
|
|
100
|
-
batchBody.push(`{\n"formValues": ${JSON.stringify(item)}\n}`);
|
|
100
|
+
batchBody.push(`{\n"formValues": ${JSON.stringify(this.formatFormValues(item))}\n}`);
|
|
101
101
|
});
|
|
102
102
|
// close batch body
|
|
103
103
|
batchBody.push(`\n\n`);
|
|
@@ -105,6 +105,13 @@ class SpoListItemBatchAddCommand extends SpoCommand {
|
|
|
105
105
|
batchBody.push(`--batch_${batchId}--\n`);
|
|
106
106
|
return batchBody;
|
|
107
107
|
}
|
|
108
|
+
formatFormValues(input) {
|
|
109
|
+
// Fix for PS 7
|
|
110
|
+
return input.map(obj => ({
|
|
111
|
+
FieldName: obj.FieldName.replace(/\\"/g, ''),
|
|
112
|
+
FieldValue: obj.FieldValue.replace(/\\"/g, '')
|
|
113
|
+
}));
|
|
114
|
+
}
|
|
108
115
|
parseBatchResponseBody(response) {
|
|
109
116
|
const batchResults = [];
|
|
110
117
|
response.split('\r\n')
|
|
@@ -151,6 +158,8 @@ class SpoListItemBatchAddCommand extends SpoCommand {
|
|
|
151
158
|
_SpoListItemBatchAddCommand_instances = new WeakSet(), _SpoListItemBatchAddCommand_initTelemetry = function _SpoListItemBatchAddCommand_initTelemetry() {
|
|
152
159
|
this.telemetry.push((args) => {
|
|
153
160
|
Object.assign(this.telemetryProperties, {
|
|
161
|
+
filePath: typeof args.options.filePath !== 'undefined',
|
|
162
|
+
csvContent: typeof args.options.csvContent !== 'undefined',
|
|
154
163
|
listId: typeof args.options.listId !== 'undefined',
|
|
155
164
|
listTitle: typeof args.options.listTitle !== 'undefined',
|
|
156
165
|
listUrl: typeof args.options.listUrl !== 'undefined'
|
|
@@ -158,9 +167,11 @@ _SpoListItemBatchAddCommand_instances = new WeakSet(), _SpoListItemBatchAddComma
|
|
|
158
167
|
});
|
|
159
168
|
}, _SpoListItemBatchAddCommand_initOptions = function _SpoListItemBatchAddCommand_initOptions() {
|
|
160
169
|
this.options.unshift({
|
|
161
|
-
option: '-p, --filePath <filePath>'
|
|
162
|
-
}, {
|
|
163
170
|
option: '-u, --webUrl <webUrl>'
|
|
171
|
+
}, {
|
|
172
|
+
option: '-p, --filePath [filePath]'
|
|
173
|
+
}, {
|
|
174
|
+
option: '-c, --csvContent [csvContent]'
|
|
164
175
|
}, {
|
|
165
176
|
option: '-l, --listId [listId]'
|
|
166
177
|
}, {
|
|
@@ -178,7 +189,7 @@ _SpoListItemBatchAddCommand_instances = new WeakSet(), _SpoListItemBatchAddComma
|
|
|
178
189
|
!validation.isValidGuid(args.options.listId)) {
|
|
179
190
|
return `${args.options.listId} in option listId is not a valid GUID`;
|
|
180
191
|
}
|
|
181
|
-
if (!fs.existsSync(args.options.filePath)) {
|
|
192
|
+
if (args.options.filePath && !fs.existsSync(args.options.filePath)) {
|
|
182
193
|
return `File with path ${args.options.filePath} does not exist`;
|
|
183
194
|
}
|
|
184
195
|
return true;
|
|
@@ -186,7 +197,7 @@ _SpoListItemBatchAddCommand_instances = new WeakSet(), _SpoListItemBatchAddComma
|
|
|
186
197
|
}, _SpoListItemBatchAddCommand_initTypes = function _SpoListItemBatchAddCommand_initTypes() {
|
|
187
198
|
this.types.string.push('webUrl', 'filePath', 'listId', 'listTitle', 'listUrl');
|
|
188
199
|
}, _SpoListItemBatchAddCommand_initOptionSets = function _SpoListItemBatchAddCommand_initOptionSets() {
|
|
189
|
-
this.optionSets.push({ options: ['listId', 'listTitle', 'listUrl'] });
|
|
200
|
+
this.optionSets.push({ options: ['listId', 'listTitle', 'listUrl'] }, { options: ['filePath', 'csvContent'] });
|
|
190
201
|
};
|
|
191
202
|
export default new SpoListItemBatchAddCommand();
|
|
192
203
|
//# sourceMappingURL=listitem-batch-add.js.map
|
|
@@ -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 _SpoPageAddCommand_instances, _SpoPageAddCommand_initTelemetry, _SpoPageAddCommand_initOptions, _SpoPageAddCommand_initValidators;
|
|
7
|
-
import { Auth } from '../../../../Auth.js';
|
|
8
7
|
import { cli } from '../../../../cli/cli.js';
|
|
9
8
|
import request from '../../../../request.js';
|
|
10
9
|
import { formatting } from '../../../../utils/formatting.js';
|
|
@@ -31,11 +30,9 @@ class SpoPageAddCommand extends SpoCommand {
|
|
|
31
30
|
__classPrivateFieldGet(this, _SpoPageAddCommand_instances, "m", _SpoPageAddCommand_initValidators).call(this);
|
|
32
31
|
}
|
|
33
32
|
async commandAction(logger, args) {
|
|
34
|
-
const resource = Auth.getResourceFromUrl(args.options.webUrl);
|
|
35
33
|
let requestDigest = '';
|
|
36
34
|
let itemId = '';
|
|
37
35
|
let pageName = args.options.name;
|
|
38
|
-
const serverRelativeSiteUrl = urlUtil.getServerRelativeSiteUrl(args.options.webUrl);
|
|
39
36
|
const fileNameWithoutExtension = pageName.replace('.aspx', '');
|
|
40
37
|
let bannerImageUrl = '';
|
|
41
38
|
let canvasContent1 = '';
|
|
@@ -52,39 +49,22 @@ class SpoPageAddCommand extends SpoCommand {
|
|
|
52
49
|
const reqDigest = await spo.getRequestDigest(args.options.webUrl);
|
|
53
50
|
requestDigest = reqDigest.FormDigestValue;
|
|
54
51
|
let requestOptions = {
|
|
55
|
-
url: `${args.options.webUrl}/_api/
|
|
52
|
+
url: `${args.options.webUrl}/_api/sitepages/pages`,
|
|
53
|
+
responseType: 'json',
|
|
56
54
|
headers: {
|
|
57
|
-
'X-RequestDigest': requestDigest,
|
|
58
55
|
'content-type': 'application/json;odata=nometadata',
|
|
59
56
|
accept: 'application/json;odata=nometadata'
|
|
60
57
|
},
|
|
61
58
|
data: {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
59
|
+
PageLayoutType: args.options.layoutType || 'Article',
|
|
60
|
+
Name: pageName,
|
|
61
|
+
PromotedState: args.options.promoteAs === 'NewsPage' ? 2 : 0,
|
|
62
|
+
Title: pageTitle
|
|
63
|
+
}
|
|
66
64
|
};
|
|
67
65
|
const template = await request.post(requestOptions);
|
|
68
66
|
itemId = template.UniqueId;
|
|
69
67
|
const listItemId = await this.getFileListItemId(args.options.webUrl, serverRelativeFileUrl);
|
|
70
|
-
const layoutType = args.options.layoutType || 'Article';
|
|
71
|
-
const listItemSetOptions = {
|
|
72
|
-
webUrl: args.options.webUrl,
|
|
73
|
-
listUrl: listServerRelativeUrl,
|
|
74
|
-
id: listItemId,
|
|
75
|
-
systemUpdate: true,
|
|
76
|
-
ContentTypeId: '0x0101009D1CB255DA76424F860D91F20E6C4118',
|
|
77
|
-
Title: pageTitle,
|
|
78
|
-
ClientSideApplicationId: 'b6917cb1-93a0-4b97-a84d-7cf49975d4ec',
|
|
79
|
-
PageLayoutType: layoutType,
|
|
80
|
-
verbose: this.verbose,
|
|
81
|
-
debug: this.debug
|
|
82
|
-
};
|
|
83
|
-
if (args.options.layoutType === 'Article') {
|
|
84
|
-
listItemSetOptions.PromotedState = 0;
|
|
85
|
-
listItemSetOptions.BannerImageUrl = `${resource}/_layouts/15/images/sitepagethumbnail.png, /_layouts/15/images/sitepagethumbnail.png`;
|
|
86
|
-
}
|
|
87
|
-
await cli.executeCommand(spoListItemSetCommand, { options: { ...listItemSetOptions, _: [] } });
|
|
88
68
|
const pageProps = await Page.checkout(pageName, args.options.webUrl, logger, this.debug, this.verbose);
|
|
89
69
|
if (pageProps) {
|
|
90
70
|
pageId = pageProps.Id;
|
|
@@ -117,7 +97,6 @@ class SpoPageAddCommand extends SpoCommand {
|
|
|
117
97
|
listUrl: listServerRelativeUrl,
|
|
118
98
|
id: listItemId,
|
|
119
99
|
systemUpdate: true,
|
|
120
|
-
PromotedState: 2,
|
|
121
100
|
FirstPublishedDate: new Date().toISOString(),
|
|
122
101
|
verbose: this.verbose,
|
|
123
102
|
debug: this.debug
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { odata } from
|
|
2
|
-
import { formatting } from
|
|
3
|
-
import { cli } from
|
|
4
|
-
const graphResource = 'https://graph.microsoft.com';
|
|
1
|
+
import { odata } from './odata.js';
|
|
2
|
+
import { formatting } from './formatting.js';
|
|
3
|
+
import { cli } from '../cli/cli.js';
|
|
5
4
|
export const aadAdministrativeUnit = {
|
|
6
5
|
/**
|
|
7
6
|
* Get an administrative unit by its display name.
|
|
@@ -10,6 +9,7 @@ export const aadAdministrativeUnit = {
|
|
|
10
9
|
* @throws Error when administrative unit was not found.
|
|
11
10
|
*/
|
|
12
11
|
async getAdministrativeUnitByDisplayName(displayName) {
|
|
12
|
+
const graphResource = 'https://graph.microsoft.com';
|
|
13
13
|
const administrativeUnits = await odata.getAllItems(`${graphResource}/v1.0/directory/administrativeUnits?$filter=displayName eq '${formatting.encodeQueryParameter(displayName)}'`);
|
|
14
14
|
if (administrativeUnits.length === 0) {
|
|
15
15
|
throw `The specified administrative unit '${displayName}' does not exist.`;
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import Global from '/docs/cmd/_global.mdx';
|
|
2
|
+
import Tabs from '@theme/Tabs';
|
|
3
|
+
import TabItem from '@theme/TabItem';
|
|
4
|
+
|
|
5
|
+
# aad administrativeunit member get
|
|
6
|
+
|
|
7
|
+
Retrieves info about a specific member of an administrative unit
|
|
8
|
+
|
|
9
|
+
## Usage
|
|
10
|
+
|
|
11
|
+
```sh
|
|
12
|
+
m365 aad administrativeunit member get [options]
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Options
|
|
16
|
+
|
|
17
|
+
```md definition-list
|
|
18
|
+
`-i, --id <id>`
|
|
19
|
+
: The id of a member to be retrieved.
|
|
20
|
+
|
|
21
|
+
`-u, --administrativeUnitId [administrativeUnitId]`
|
|
22
|
+
: The id of the administrative unit. Specify either `administrativeUnitId` or `administrativeUnitName`.
|
|
23
|
+
|
|
24
|
+
`-n, --administrativeUnitName [administrativeUnitName]`
|
|
25
|
+
: The name of the administrative unit. Specify either `administrativeUnitId` or `administrativeUnitName`.
|
|
26
|
+
|
|
27
|
+
`-p, --properties [properties]`
|
|
28
|
+
: Comma-separated list of properties to retrieve.
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
<Global />
|
|
32
|
+
|
|
33
|
+
## Remarks
|
|
34
|
+
|
|
35
|
+
To get the member of a hidden membership in an administrative unit, the `Member.Read.Hidden` permission is required.
|
|
36
|
+
|
|
37
|
+
When the `properties` option includes values with a `/`, for example: `manager/displayName`, an additional `$expand` query parameter will be included on manager.
|
|
38
|
+
|
|
39
|
+
## Examples
|
|
40
|
+
|
|
41
|
+
Get information about a member specified by id from an administrative unit specified by id
|
|
42
|
+
|
|
43
|
+
```sh
|
|
44
|
+
m365 aad administrativeunit member get --id 64131a70-beb9-4ccb-b590-4401e58446ec --administrativeUnitId 03c4c9dc-6f0c-4c4f-a4e6-0c9ed80f54c7
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Get information about a member specified by id from an administrative unit specified by name
|
|
48
|
+
|
|
49
|
+
```sh
|
|
50
|
+
m365 aad administrativeunit member get --id 64131a70-beb9-4ccb-b590-4401e58446ec --administrativeUnitName 'Marketing Division'
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Response
|
|
54
|
+
|
|
55
|
+
<Tabs>
|
|
56
|
+
<TabItem value="JSON">
|
|
57
|
+
|
|
58
|
+
```json
|
|
59
|
+
{
|
|
60
|
+
"id": "64131a70-beb9-4ccb-b590-4401e58446ec",
|
|
61
|
+
"businessPhones": [
|
|
62
|
+
"+20 255501070"
|
|
63
|
+
],
|
|
64
|
+
"displayName": "Pradeep Gupta",
|
|
65
|
+
"givenName": "Pradeep",
|
|
66
|
+
"jobTitle": "Accountant",
|
|
67
|
+
"mail": "PradeepG@contoso.com",
|
|
68
|
+
"mobilePhone": null,
|
|
69
|
+
"officeLocation": "98/2202",
|
|
70
|
+
"preferredLanguage": "en-US",
|
|
71
|
+
"surname": "Gupta",
|
|
72
|
+
"userPrincipalName": "PradeepG@contoso.com",
|
|
73
|
+
"type": "user"
|
|
74
|
+
}
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
</TabItem>
|
|
78
|
+
<TabItem value="Text">
|
|
79
|
+
|
|
80
|
+
```text
|
|
81
|
+
businessPhones : ["+20 255501070"]
|
|
82
|
+
displayName : Pradeep Gupta
|
|
83
|
+
givenName : Pradeep
|
|
84
|
+
id : 64131a70-beb9-4ccb-b590-4401e58446ec
|
|
85
|
+
jobTitle : Accountant
|
|
86
|
+
mail : PradeepG@contoso.com
|
|
87
|
+
mobilePhone : null
|
|
88
|
+
officeLocation : 98/2202
|
|
89
|
+
preferredLanguage: en-US
|
|
90
|
+
surname : Gupta
|
|
91
|
+
type : user
|
|
92
|
+
userPrincipalName: PradeepG@contoso.com
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
</TabItem>
|
|
96
|
+
<TabItem value="CSV">
|
|
97
|
+
|
|
98
|
+
```csv
|
|
99
|
+
id,displayName,givenName,jobTitle,mail,officeLocation,preferredLanguage,surname,userPrincipalName,type
|
|
100
|
+
64131a70-beb9-4ccb-b590-4401e58446ec,Pradeep Gupta,Pradeep,Accountant,PradeepG@contoso.com,98/2202,en-US,Gupta,PradeepG@contoso.com,user
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
</TabItem>
|
|
104
|
+
<TabItem value="Markdown">
|
|
105
|
+
|
|
106
|
+
```md
|
|
107
|
+
Date: 11/10/2023
|
|
108
|
+
|
|
109
|
+
## Pradeep Gupta (64131a70-beb9-4ccb-b590-4401e58446ec)
|
|
110
|
+
|
|
111
|
+
Property | Value
|
|
112
|
+
---------|-------
|
|
113
|
+
id | 64131a70-beb9-4ccb-b590-4401e58446ec
|
|
114
|
+
displayName | Pradeep Gupta
|
|
115
|
+
givenName | Pradeep
|
|
116
|
+
jobTitle | Accountant
|
|
117
|
+
mail | PradeepG@contoso.com
|
|
118
|
+
officeLocation | 98/2202
|
|
119
|
+
preferredLanguage | en-US
|
|
120
|
+
surname | Gupta
|
|
121
|
+
userPrincipalName | PradeepG@contoso.com
|
|
122
|
+
type | user
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
</TabItem>
|
|
126
|
+
</Tabs>
|
|
127
|
+
|
|
128
|
+
## More information
|
|
129
|
+
|
|
130
|
+
- Administrative units: https://learn.microsoft.com/entra/identity/role-based-access-control/administrative-units
|
|
@@ -24,6 +24,9 @@ m365 search externalconnection schema add
|
|
|
24
24
|
|
|
25
25
|
`-s, --schema [schema]`
|
|
26
26
|
: The schema object to be added.
|
|
27
|
+
|
|
28
|
+
`--wait`
|
|
29
|
+
: Wait for the schema to be added before completing the command.
|
|
27
30
|
```
|
|
28
31
|
|
|
29
32
|
<Global />
|
|
@@ -36,6 +39,16 @@ Adds a new schema to a specific external connection.
|
|
|
36
39
|
m365 external connection schema add --externalConnectionId 'CliConnectionId' --schema '{"baseType":"microsoft.graph.externalItem","properties":[{"name":"ticketTitle","type":"String","isSearchable":"true","isRetrievable":"true","labels":["title"]},{"name":"priority","type":"String","isQueryable":"true","isRetrievable":"true","isSearchable":"false"},{"name":"assignee","type":"String","isRetrievable":"true"}]}'
|
|
37
40
|
```
|
|
38
41
|
|
|
42
|
+
Adds a new schema to a specific external connection and wait for its provisioning to complete.
|
|
43
|
+
|
|
44
|
+
```sh
|
|
45
|
+
m365 external connection schema add --externalConnectionId 'CliConnectionId' --schema '{"baseType":"microsoft.graph.externalItem","properties":[{"name":"ticketTitle","type":"String","isSearchable":"true","isRetrievable":"true","labels":["title"]},{"name":"priority","type":"String","isQueryable":"true","isRetrievable":"true","isSearchable":"false"},{"name":"assignee","type":"String","isRetrievable":"true"}]}' --wait
|
|
46
|
+
```
|
|
47
|
+
|
|
39
48
|
## Response
|
|
40
49
|
|
|
41
|
-
|
|
50
|
+
Upon executing the command, you'll receive the job status URL. This URL enables manual checking of the job's progress if automated polling fails or for interactive monitoring purposes.
|
|
51
|
+
|
|
52
|
+
```text
|
|
53
|
+
"https://graph.microsoft.com/v1.0/external/connections/MyApp/operations/795b6888-4093-0fe7-6270-ddbcac9ebd3a"
|
|
54
|
+
```
|
|
@@ -20,6 +20,12 @@ m365 pa app get [options]
|
|
|
20
20
|
|
|
21
21
|
`-d, --displayName [displayName]`
|
|
22
22
|
: The display name of the Microsoft Power App to get information about.
|
|
23
|
+
|
|
24
|
+
`--asAdmin`
|
|
25
|
+
: Run the command as admin for apps you don't have permission to.
|
|
26
|
+
|
|
27
|
+
`-e, --environmentName [environmentName]`
|
|
28
|
+
: The name of the environment. Required when using `asAdmin`.
|
|
23
29
|
```
|
|
24
30
|
|
|
25
31
|
<Global />
|
|
@@ -32,6 +38,9 @@ This command is based on an API that is currently in preview and is subject to c
|
|
|
32
38
|
|
|
33
39
|
:::
|
|
34
40
|
|
|
41
|
+
As a maker, you are able to retrieve the Power Apps you have permission to. As an administrator, you are also able to retrieve Power Apps from other users you don't have permission to. To get the app from another user, use the `asAdmin` option and make sure to specify the `environment` option as well.
|
|
42
|
+
|
|
43
|
+
|
|
35
44
|
If you try to retrieve a non-existing Microsoft Power App, you will get the `Request failed with status code 404` error.
|
|
36
45
|
|
|
37
46
|
## Examples
|
|
@@ -48,6 +57,12 @@ Get information about the specified Microsoft Power App by the app's display nam
|
|
|
48
57
|
m365 pa app get --displayName App
|
|
49
58
|
```
|
|
50
59
|
|
|
60
|
+
Get information about the specific app you do not have access to.
|
|
61
|
+
|
|
62
|
+
```sh
|
|
63
|
+
m365 pa app get --name 3989cb59-ce1a-4a5c-bb78-257c5c39381d --environmentName Default-d87a7535-dd31-4437-bfe1-95340acd55c5 --asAdmin
|
|
64
|
+
```
|
|
65
|
+
|
|
51
66
|
## Response
|
|
52
67
|
|
|
53
68
|
<Tabs>
|
|
@@ -18,6 +18,12 @@ m365 pa app remove [options]
|
|
|
18
18
|
|
|
19
19
|
`-f, --force`
|
|
20
20
|
: Don't prompt for confirmation
|
|
21
|
+
|
|
22
|
+
`--asAdmin`
|
|
23
|
+
: Run the command as admin for apps you don't own.
|
|
24
|
+
|
|
25
|
+
`-e, --environmentName [environmentName]`
|
|
26
|
+
: The name of the environment. Required when using `asAdmin`.
|
|
21
27
|
```
|
|
22
28
|
|
|
23
29
|
<Global />
|
|
@@ -26,6 +32,8 @@ m365 pa app remove [options]
|
|
|
26
32
|
|
|
27
33
|
By default, the command will try to remove a Power App. As maker, you are able to delete the Power Apps you own. As administrator, you are also able to delete Power Apps from other users.
|
|
28
34
|
|
|
35
|
+
To remove an app you do not own, use the `asAdmin` option and make sure to specify the `environmentName` option as well.
|
|
36
|
+
|
|
29
37
|
To remove a model-driven Power App you need administrator permissions.
|
|
30
38
|
|
|
31
39
|
If the Power App with the name you specified doesn't exist, you will get the `Error: App 'abc' does not exist` error.
|
|
@@ -44,6 +52,12 @@ Removes the specified Power App without confirmation
|
|
|
44
52
|
m365 pa app remove --name 3989cb59-ce1a-4a5c-bb78-257c5c39381d --force
|
|
45
53
|
```
|
|
46
54
|
|
|
55
|
+
Removes the specified Power App you don't own
|
|
56
|
+
|
|
57
|
+
```sh
|
|
58
|
+
m365 pa app remove --name 3989cb59-ce1a-4a5c-bb78-257c5c39381d --environmentName Default-d87a7535-dd31-4437-bfe1-95340acd55c5 --asAdmin
|
|
59
|
+
```
|
|
60
|
+
|
|
47
61
|
## Response
|
|
48
62
|
|
|
49
63
|
The command won't return a response on success.
|
|
@@ -13,12 +13,15 @@ m365 spo listitem batch add [options]
|
|
|
13
13
|
## Options
|
|
14
14
|
|
|
15
15
|
```md definition-list
|
|
16
|
-
`-p, --filePath <filePath>`
|
|
17
|
-
: The absolute or relative path to a flat file containing the list items.
|
|
18
|
-
|
|
19
16
|
`-u, --webUrl <webUrl>`
|
|
20
17
|
: URL of the site.
|
|
21
18
|
|
|
19
|
+
`-p, --filePath [filePath]`
|
|
20
|
+
: The absolute or relative path to a flat file containing the list items. Specify `filePath` or `csvContent`, but not both.
|
|
21
|
+
|
|
22
|
+
`-c, --csvContent [csvContent]`
|
|
23
|
+
: A string content in CSV-format containing the list items. Specify `filePath` or `csvContent`, but not both.
|
|
24
|
+
|
|
22
25
|
`-l, --listId [listId]`
|
|
23
26
|
: ID of the list. Specify either `listTitle`, `listId` or `listUrl`, but not multiple.
|
|
24
27
|
|
|
@@ -54,6 +57,25 @@ Add a batch of items to a list retrieved by title in a specific site
|
|
|
54
57
|
m365 spo listitem batch add --filePath "C:\Path\To\Csv\CsvFile.csv" --webUrl https://contoso.sharepoint.com/sites/project-x --listTitle "Demo List"
|
|
55
58
|
```
|
|
56
59
|
|
|
60
|
+
Add a batch of items to a list retrieved by title in a specific site using csv content
|
|
61
|
+
|
|
62
|
+
```sh
|
|
63
|
+
$obj = @(
|
|
64
|
+
[PSCustomObject]@{
|
|
65
|
+
Title = "Item A"
|
|
66
|
+
Age = 10
|
|
67
|
+
},
|
|
68
|
+
[PSCustomObject]@{
|
|
69
|
+
Title = "Item B"
|
|
70
|
+
Age = 20
|
|
71
|
+
}
|
|
72
|
+
)
|
|
73
|
+
|
|
74
|
+
$csvContent = $obj | ConvertTo-Csv -NoTypeInformation -Delimiter "," | Out-String | ForEach-Object { $_.Replace('"','\"') }
|
|
75
|
+
|
|
76
|
+
m365 spo listitem batch add --csvContent $csvContent --webUrl https://contoso.sharepoint.com/sites/project-x --listTitle "Demo List"
|
|
77
|
+
```
|
|
78
|
+
|
|
57
79
|
Add a batch of items to a list retrieved by Id in a specific site
|
|
58
80
|
|
|
59
81
|
```sh
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pnp/cli-microsoft365",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.4.0",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@pnp/cli-microsoft365",
|
|
9
|
-
"version": "7.
|
|
9
|
+
"version": "7.4.0",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@azure/msal-common": "^14.5.0",
|
package/package.json
CHANGED