@pnp/cli-microsoft365 11.4.0-beta.40f818c → 11.4.0-beta.810a987
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 +1 -1
- package/dist/cli/cli.js +1 -1
- package/dist/m365/commands/login.js +5 -1
- package/dist/m365/connection/commands/connection-set.js +15 -29
- package/dist/m365/spe/commands/container/container-recyclebinitem-remove.js +96 -0
- package/dist/m365/spe/commands.js +1 -0
- package/dist/m365/spo/commands/file/file-add.js +49 -11
- package/dist/m365/spo/commands/listitem/listitem-set.js +1 -1
- package/dist/m365/spo/commands/page/page-header-set.js +97 -89
- package/dist/m365/spo/commands/page/page-set.js +26 -26
- package/dist/m365/spp/commands/autofillcolumn/autofillcolumn-set.js +166 -0
- package/dist/m365/spp/commands.js +1 -0
- package/dist/utils/spo.js +1 -2
- package/docs/docs/cmd/spe/container/container-recyclebinitem-remove.mdx +79 -0
- package/docs/docs/cmd/spo/file/file-add.mdx +140 -1
- package/docs/docs/cmd/spo/page/page-header-set.mdx +28 -8
- package/docs/docs/cmd/spo/page/page-set.mdx +35 -5
- package/docs/docs/cmd/spp/autofillcolumn/autofillcolumn-set.mdx +104 -0
- package/eslint.config.mjs +1 -0
- package/package.json +2 -1
|
@@ -48,24 +48,20 @@ class SpoPageSetCommand extends SpoCommand {
|
|
|
48
48
|
const serverRelativeFileUrl = `${listServerRelativeUrl}/${pageName}`;
|
|
49
49
|
const listUrl = urlUtil.getServerRelativePath(args.options.webUrl, listServerRelativeUrl);
|
|
50
50
|
const requestUrl = `${args.options.webUrl}/_api/web/GetList('${formatting.encodeQueryParameter(listUrl)}')`;
|
|
51
|
-
const needsToSavePage = !!args.options.title || !!args.options.description;
|
|
51
|
+
const needsToSavePage = !!args.options.title || !!args.options.description || !!args.options.content;
|
|
52
52
|
try {
|
|
53
53
|
const requestDigestResult = await spo.getRequestDigest(args.options.webUrl);
|
|
54
54
|
const requestDigest = requestDigestResult.FormDigestValue;
|
|
55
55
|
const page = await Page.checkout(args.options.name, args.options.webUrl, logger, this.verbose);
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
authorByline = page.AuthorByline;
|
|
65
|
-
}
|
|
56
|
+
pageTitle = pageTitle || page.Title;
|
|
57
|
+
pageId = page.Id;
|
|
58
|
+
bannerImageUrl = page.BannerImageUrl;
|
|
59
|
+
canvasContent1 = args.options.content || page.CanvasContent1;
|
|
60
|
+
layoutWebpartsContent = page.LayoutWebpartsContent;
|
|
61
|
+
pageDescription = pageDescription || page.Description;
|
|
62
|
+
topicHeader = page.TopicHeader;
|
|
63
|
+
authorByline = page.AuthorByline;
|
|
66
64
|
if (args.options.layoutType) {
|
|
67
|
-
const file = await spo.getFileAsListItemByUrl(args.options.webUrl, serverRelativeFileUrl, logger, this.verbose);
|
|
68
|
-
const itemId = file.Id;
|
|
69
65
|
const listItemSetOptions = {
|
|
70
66
|
PageLayoutType: args.options.layoutType
|
|
71
67
|
};
|
|
@@ -73,7 +69,7 @@ class SpoPageSetCommand extends SpoCommand {
|
|
|
73
69
|
listItemSetOptions.PromotedState = 0;
|
|
74
70
|
listItemSetOptions.BannerImageUrl = `${resource}/_layouts/15/images/sitepagethumbnail.png, /_layouts/15/images/sitepagethumbnail.png`;
|
|
75
71
|
}
|
|
76
|
-
await spo.systemUpdateListItem(requestUrl,
|
|
72
|
+
await spo.systemUpdateListItem(requestUrl, pageId, logger, this.verbose, listItemSetOptions);
|
|
77
73
|
}
|
|
78
74
|
if (args.options.promoteAs) {
|
|
79
75
|
const requestOptions = {
|
|
@@ -95,18 +91,14 @@ class SpoPageSetCommand extends SpoCommand {
|
|
|
95
91
|
await request.post(requestOptions);
|
|
96
92
|
break;
|
|
97
93
|
case 'NewsPage': {
|
|
98
|
-
const newsPageItem = await spo.getFileAsListItemByUrl(args.options.webUrl, serverRelativeFileUrl, logger, this.verbose);
|
|
99
|
-
const newsPageItemId = newsPageItem.Id;
|
|
100
94
|
const listItemSetOptions = {
|
|
101
95
|
PromotedState: 2,
|
|
102
96
|
FirstPublishedDate: new Date().toISOString()
|
|
103
97
|
};
|
|
104
|
-
await spo.systemUpdateListItem(requestUrl,
|
|
98
|
+
await spo.systemUpdateListItem(requestUrl, pageId, logger, this.verbose, listItemSetOptions);
|
|
105
99
|
break;
|
|
106
100
|
}
|
|
107
101
|
case 'Template': {
|
|
108
|
-
const templateItem = await spo.getFileAsListItemByUrl(args.options.webUrl, serverRelativeFileUrl, logger, this.verbose);
|
|
109
|
-
const templateItemId = templateItem.Id;
|
|
110
102
|
requestOptions.headers = {
|
|
111
103
|
'X-RequestDigest': requestDigest,
|
|
112
104
|
'content-type': 'application/json;odata=nometadata',
|
|
@@ -114,7 +106,7 @@ class SpoPageSetCommand extends SpoCommand {
|
|
|
114
106
|
'IF-MATCH': '*',
|
|
115
107
|
accept: 'application/json;odata=nometadata'
|
|
116
108
|
};
|
|
117
|
-
requestOptions.url = `${args.options.webUrl}/_api/SitePages/Pages(${
|
|
109
|
+
requestOptions.url = `${args.options.webUrl}/_api/SitePages/Pages(${pageId})/SavePageAsTemplate`;
|
|
118
110
|
const res = await request.post(requestOptions);
|
|
119
111
|
if (fileNameWithoutExtension) {
|
|
120
112
|
pageData.Title = fileNameWithoutExtension;
|
|
@@ -202,12 +194,15 @@ class SpoPageSetCommand extends SpoCommand {
|
|
|
202
194
|
await request.post(requestOptions);
|
|
203
195
|
}
|
|
204
196
|
if (args.options.demoteFrom === 'NewsPage') {
|
|
205
|
-
const file = await spo.getFileAsListItemByUrl(args.options.webUrl, serverRelativeFileUrl, logger, this.verbose);
|
|
206
|
-
const fileId = file.Id;
|
|
207
197
|
const listItemSetOptions = {
|
|
208
198
|
PromotedState: 0
|
|
209
199
|
};
|
|
210
|
-
await spo.systemUpdateListItem(requestUrl,
|
|
200
|
+
await spo.systemUpdateListItem(requestUrl, pageId, logger, this.verbose, listItemSetOptions);
|
|
201
|
+
}
|
|
202
|
+
if (args.options.isRetired !== undefined) {
|
|
203
|
+
await spo.systemUpdateListItem(requestUrl, pageId, logger, this.verbose, {
|
|
204
|
+
_SPIsRetired: args.options.isRetired
|
|
205
|
+
});
|
|
211
206
|
}
|
|
212
207
|
let requestOptions;
|
|
213
208
|
if (!args.options.publish) {
|
|
@@ -253,7 +248,8 @@ _SpoPageSetCommand_instances = new WeakSet(), _SpoPageSetCommand_initTelemetry =
|
|
|
253
248
|
publishMessage: typeof args.options.publishMessage !== 'undefined',
|
|
254
249
|
description: typeof args.options.description !== 'undefined',
|
|
255
250
|
title: typeof args.options.title !== 'undefined',
|
|
256
|
-
content: typeof args.options.content !== 'undefined'
|
|
251
|
+
content: typeof args.options.content !== 'undefined',
|
|
252
|
+
isRetired: typeof args.options.isRetired !== 'undefined'
|
|
257
253
|
});
|
|
258
254
|
});
|
|
259
255
|
}, _SpoPageSetCommand_initOptions = function _SpoPageSetCommand_initOptions() {
|
|
@@ -283,16 +279,20 @@ _SpoPageSetCommand_instances = new WeakSet(), _SpoPageSetCommand_initTelemetry =
|
|
|
283
279
|
option: '--title [title]'
|
|
284
280
|
}, {
|
|
285
281
|
option: '--content [content]'
|
|
282
|
+
}, {
|
|
283
|
+
option: '--isRetired [isRetired]',
|
|
284
|
+
autocomplete: ['true', 'false']
|
|
286
285
|
});
|
|
287
286
|
}, _SpoPageSetCommand_initTypes = function _SpoPageSetCommand_initTypes() {
|
|
288
|
-
this.types.boolean.push('commentsEnabled');
|
|
287
|
+
this.types.boolean.push('commentsEnabled', 'isRetired');
|
|
289
288
|
}, _SpoPageSetCommand_initValidators = function _SpoPageSetCommand_initValidators() {
|
|
290
289
|
this.validators.push(async (args) => {
|
|
291
290
|
const isValidSharePointUrl = validation.isValidSharePointUrl(args.options.webUrl);
|
|
292
291
|
if (isValidSharePointUrl !== true) {
|
|
293
292
|
return isValidSharePointUrl;
|
|
294
293
|
}
|
|
295
|
-
if (!args.options.layoutType && !args.options.promoteAs && !args.options.demoteFrom && args.options.commentsEnabled === undefined &&
|
|
294
|
+
if (!args.options.layoutType && !args.options.promoteAs && !args.options.demoteFrom && args.options.commentsEnabled === undefined &&
|
|
295
|
+
!args.options.publish && !args.options.description && !args.options.title && !args.options.content && args.options.isRetired === undefined) {
|
|
296
296
|
return 'Specify at least one option to update.';
|
|
297
297
|
}
|
|
298
298
|
if (args.options.layoutType &&
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import request from '../../../../request.js';
|
|
2
|
+
import { formatting } from '../../../../utils/formatting.js';
|
|
3
|
+
import { urlUtil } from '../../../../utils/urlUtil.js';
|
|
4
|
+
import { validation } from '../../../../utils/validation.js';
|
|
5
|
+
import SpoCommand from '../../../base/SpoCommand.js';
|
|
6
|
+
import commands from '../../commands.js';
|
|
7
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
8
|
+
import z from 'zod';
|
|
9
|
+
var AllowedFieldTypeKind;
|
|
10
|
+
(function (AllowedFieldTypeKind) {
|
|
11
|
+
AllowedFieldTypeKind[AllowedFieldTypeKind["Integer"] = 1] = "Integer";
|
|
12
|
+
AllowedFieldTypeKind[AllowedFieldTypeKind["Text"] = 2] = "Text";
|
|
13
|
+
AllowedFieldTypeKind[AllowedFieldTypeKind["Note"] = 3] = "Note";
|
|
14
|
+
AllowedFieldTypeKind[AllowedFieldTypeKind["DateTime"] = 4] = "DateTime";
|
|
15
|
+
AllowedFieldTypeKind[AllowedFieldTypeKind["Counter"] = 5] = "Counter";
|
|
16
|
+
AllowedFieldTypeKind[AllowedFieldTypeKind["Choice"] = 6] = "Choice";
|
|
17
|
+
AllowedFieldTypeKind[AllowedFieldTypeKind["Boolean"] = 8] = "Boolean";
|
|
18
|
+
AllowedFieldTypeKind[AllowedFieldTypeKind["Number"] = 9] = "Number";
|
|
19
|
+
AllowedFieldTypeKind[AllowedFieldTypeKind["Currency"] = 10] = "Currency";
|
|
20
|
+
AllowedFieldTypeKind[AllowedFieldTypeKind["URL"] = 11] = "URL";
|
|
21
|
+
AllowedFieldTypeKind[AllowedFieldTypeKind["Computed"] = 12] = "Computed";
|
|
22
|
+
AllowedFieldTypeKind[AllowedFieldTypeKind["MultiChoice"] = 15] = "MultiChoice";
|
|
23
|
+
AllowedFieldTypeKind[AllowedFieldTypeKind["GridChoice"] = 16] = "GridChoice";
|
|
24
|
+
})(AllowedFieldTypeKind || (AllowedFieldTypeKind = {}));
|
|
25
|
+
export const options = z.strictObject({
|
|
26
|
+
...globalOptionsZod.shape,
|
|
27
|
+
siteUrl: z.string().refine(url => validation.isValidSharePointUrl(url) === true, {
|
|
28
|
+
error: e => `'${e.input}' is not a valid SharePoint Online site URL.`
|
|
29
|
+
}).alias('u'),
|
|
30
|
+
listTitle: z.string().optional(),
|
|
31
|
+
listId: z.string().uuid()
|
|
32
|
+
.refine(value => validation.isValidGuid(value), {
|
|
33
|
+
error: e => `'${e.input}' in parameter listId is not a valid GUID.`
|
|
34
|
+
}).optional(),
|
|
35
|
+
listUrl: z.string().optional(),
|
|
36
|
+
columnId: z.string().uuid()
|
|
37
|
+
.refine(value => validation.isValidGuid(value), {
|
|
38
|
+
error: e => `'${e.input}' in parameter columnId is not a valid GUID.`
|
|
39
|
+
}).optional().alias('i'),
|
|
40
|
+
columnTitle: z.string().optional().alias('t'),
|
|
41
|
+
columnInternalName: z.string().optional(),
|
|
42
|
+
prompt: z.string().optional(),
|
|
43
|
+
isEnabled: z.boolean().optional()
|
|
44
|
+
}).strict();
|
|
45
|
+
class SppAutofillColumnSetCommand extends SpoCommand {
|
|
46
|
+
get name() {
|
|
47
|
+
return commands.AUTOFILLCOLUMN_SET;
|
|
48
|
+
}
|
|
49
|
+
get description() {
|
|
50
|
+
return 'Applies the autofill option to the selected column';
|
|
51
|
+
}
|
|
52
|
+
get schema() {
|
|
53
|
+
return options;
|
|
54
|
+
}
|
|
55
|
+
getRefinedSchema(schema) {
|
|
56
|
+
return schema
|
|
57
|
+
.refine(options => [options.columnId, options.columnTitle, options.columnInternalName].filter(Boolean).length === 1, {
|
|
58
|
+
message: `Specify exactly one of the following options: 'columnId', 'columnTitle' or 'columnInternalName'.`
|
|
59
|
+
})
|
|
60
|
+
.refine(options => [options.listTitle, options.listId, options.listUrl].filter(Boolean).length === 1, {
|
|
61
|
+
message: `Specify exactly one of the following options: 'listTitle', 'listId' or 'listUrl'.`
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
async commandAction(logger, args) {
|
|
65
|
+
try {
|
|
66
|
+
if (this.verbose) {
|
|
67
|
+
await logger.log(`Applying an autofill column to a column...`);
|
|
68
|
+
}
|
|
69
|
+
const siteUrl = urlUtil.removeTrailingSlashes(args.options.siteUrl);
|
|
70
|
+
const listInstance = await this.getDocumentLibraryInfo(siteUrl, args.options);
|
|
71
|
+
if (listInstance.BaseType !== 1) {
|
|
72
|
+
throw Error(`The specified list is not a document library.`);
|
|
73
|
+
}
|
|
74
|
+
const column = await this.getColumn(siteUrl, args.options, listInstance.Id);
|
|
75
|
+
if (!Object.values(AllowedFieldTypeKind).includes(column.FieldTypeKind)) {
|
|
76
|
+
throw Error(`The specified column has incorrect type.`);
|
|
77
|
+
}
|
|
78
|
+
if (column.AutofillInfo) {
|
|
79
|
+
await this.updateAutoFillColumnSettings(siteUrl, args.options, column.Id, listInstance.Id, column.AutofillInfo);
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
if (!args.options.prompt) {
|
|
83
|
+
throw Error(`The prompt parameter is required when setting the autofill column for the first time.`);
|
|
84
|
+
}
|
|
85
|
+
await this.applyAutoFillColumnSettings(siteUrl, args.options, column.Id, column.Title, listInstance.Id);
|
|
86
|
+
}
|
|
87
|
+
catch (err) {
|
|
88
|
+
this.handleRejectedODataJsonPromise(err);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
getDocumentLibraryInfo(siteUrl, options) {
|
|
92
|
+
let requestUrl = `${siteUrl}/_api/web`;
|
|
93
|
+
if (options.listId) {
|
|
94
|
+
requestUrl += `/lists(guid'${formatting.encodeQueryParameter(options.listId)}')`;
|
|
95
|
+
}
|
|
96
|
+
else if (options.listTitle) {
|
|
97
|
+
requestUrl += `/lists/getByTitle('${formatting.encodeQueryParameter(options.listTitle)}')`;
|
|
98
|
+
}
|
|
99
|
+
else if (options.listUrl) {
|
|
100
|
+
const listServerRelativeUrl = urlUtil.getServerRelativePath(siteUrl, options.listUrl);
|
|
101
|
+
requestUrl += `/GetList('${formatting.encodeQueryParameter(listServerRelativeUrl)}')`;
|
|
102
|
+
}
|
|
103
|
+
const requestOptions = {
|
|
104
|
+
url: `${requestUrl}?$select=Id,BaseType`,
|
|
105
|
+
headers: {
|
|
106
|
+
'accept': 'application/json;odata=nometadata'
|
|
107
|
+
},
|
|
108
|
+
responseType: 'json'
|
|
109
|
+
};
|
|
110
|
+
return request.get(requestOptions);
|
|
111
|
+
}
|
|
112
|
+
getColumn(siteUrl, options, listId) {
|
|
113
|
+
let fieldRestUrl = '';
|
|
114
|
+
if (options.columnId) {
|
|
115
|
+
fieldRestUrl = `/getbyid('${formatting.encodeQueryParameter(options.columnId)}')`;
|
|
116
|
+
}
|
|
117
|
+
else {
|
|
118
|
+
fieldRestUrl = `/getbyinternalnameortitle('${formatting.encodeQueryParameter((options.columnTitle || options.columnInternalName))}')`;
|
|
119
|
+
}
|
|
120
|
+
const requestOptions = {
|
|
121
|
+
url: `${siteUrl}/_api/web/lists(guid'${formatting.encodeQueryParameter(listId)}')/fields${fieldRestUrl}?&$select=Id,Title,FieldTypeKind,AutofillInfo`,
|
|
122
|
+
headers: {
|
|
123
|
+
accept: 'application/json;odata=nometadata'
|
|
124
|
+
},
|
|
125
|
+
responseType: 'json'
|
|
126
|
+
};
|
|
127
|
+
return request.get(requestOptions);
|
|
128
|
+
}
|
|
129
|
+
updateAutoFillColumnSettings(siteUrl, options, columnId, listInstanceId, autofillInfo) {
|
|
130
|
+
const autofillInfoObj = JSON.parse(autofillInfo);
|
|
131
|
+
const requestOptions = {
|
|
132
|
+
url: `${siteUrl}/_api/machinelearning/SetColumnLLMInfo`,
|
|
133
|
+
headers: {
|
|
134
|
+
accept: 'application/json;odata=nometadata'
|
|
135
|
+
},
|
|
136
|
+
responseType: 'json',
|
|
137
|
+
data: {
|
|
138
|
+
autofillPrompt: options.prompt ?? autofillInfoObj.LLM.Prompt,
|
|
139
|
+
columnId: columnId,
|
|
140
|
+
docLibId: `{${listInstanceId}}`,
|
|
141
|
+
isEnabled: options.isEnabled !== undefined ? options.isEnabled : autofillInfoObj.LLM.IsEnabled
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
return request.post(requestOptions);
|
|
145
|
+
}
|
|
146
|
+
applyAutoFillColumnSettings(siteUrl, options, columnId, columnTitle, listInstanceId) {
|
|
147
|
+
const requestOptions = {
|
|
148
|
+
url: `${siteUrl}/_api/machinelearning/SetSyntexPoweredColumnPrompts`,
|
|
149
|
+
headers: {
|
|
150
|
+
accept: 'application/json;odata=nometadata'
|
|
151
|
+
},
|
|
152
|
+
data: {
|
|
153
|
+
docLibId: `{${listInstanceId}}`,
|
|
154
|
+
syntexPoweredColumnPrompts: JSON.stringify([{
|
|
155
|
+
columnId: columnId,
|
|
156
|
+
columnName: columnTitle,
|
|
157
|
+
prompt: options.prompt,
|
|
158
|
+
isEnabled: options.isEnabled !== undefined ? options.isEnabled : true
|
|
159
|
+
}])
|
|
160
|
+
}
|
|
161
|
+
};
|
|
162
|
+
return request.post(requestOptions);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
export default new SppAutofillColumnSetCommand();
|
|
166
|
+
//# sourceMappingURL=autofillcolumn-set.js.map
|
package/dist/utils/spo.js
CHANGED
|
@@ -1307,9 +1307,8 @@ export const spo = {
|
|
|
1307
1307
|
if (response.indexOf("ErrorMessage") > -1) {
|
|
1308
1308
|
throw `Error occurred in systemUpdate operation - ${response}`;
|
|
1309
1309
|
}
|
|
1310
|
-
const id = Number(itemId);
|
|
1311
1310
|
const requestOptionsItems = {
|
|
1312
|
-
url: `${absoluteListUrl}/items(${
|
|
1311
|
+
url: `${absoluteListUrl}/items(${itemId})`,
|
|
1313
1312
|
headers: {
|
|
1314
1313
|
'accept': 'application/json;odata=nometadata'
|
|
1315
1314
|
},
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import Global from '/docs/cmd/_global.mdx';
|
|
2
|
+
import Tabs from '@theme/Tabs';
|
|
3
|
+
import TabItem from '@theme/TabItem';
|
|
4
|
+
|
|
5
|
+
# spe container recyclebinitem remove
|
|
6
|
+
|
|
7
|
+
Permanently removes a container from the recycle bin
|
|
8
|
+
|
|
9
|
+
## Usage
|
|
10
|
+
|
|
11
|
+
```sh
|
|
12
|
+
m365 spe container recyclebinitem remove [options]
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Options
|
|
16
|
+
|
|
17
|
+
```md definition-list
|
|
18
|
+
`-i, --id [id]`
|
|
19
|
+
: The container id. Specify either `id` or `name` but not both.
|
|
20
|
+
|
|
21
|
+
`-n, --name [name]`
|
|
22
|
+
: The display name of the Container. Specify either `id` or `name` but not both.
|
|
23
|
+
|
|
24
|
+
`--containerTypeId [containerTypeId]`
|
|
25
|
+
: The container type ID of the container instance. Use either `containerTypeId` or `containerTypeName` but not both.
|
|
26
|
+
|
|
27
|
+
`--containerTypeName [containerTypeName]`
|
|
28
|
+
: The container type name of the container instance. Use either `containerTypeId` or `containerTypeName` but not both.
|
|
29
|
+
|
|
30
|
+
`-f, --force`
|
|
31
|
+
: Don't prompt for confirmation.
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
<Global />
|
|
35
|
+
|
|
36
|
+
## Permissions
|
|
37
|
+
|
|
38
|
+
<Tabs>
|
|
39
|
+
<TabItem value="Delegated">
|
|
40
|
+
|
|
41
|
+
| Resource | Permissions |
|
|
42
|
+
|-----------------|--------------------------------------------------------------------|
|
|
43
|
+
| Microsoft Graph | FileStorageContainer.Selected, FileStorageContainerType.Manage.All |
|
|
44
|
+
|
|
45
|
+
</TabItem>
|
|
46
|
+
<TabItem value="Application">
|
|
47
|
+
|
|
48
|
+
This command only supports application permissions when using the `containerTypeId` option.
|
|
49
|
+
|
|
50
|
+
| Resource | Permissions |
|
|
51
|
+
|-----------------|-------------------------------|
|
|
52
|
+
| Microsoft Graph | FileStorageContainer.Selected |
|
|
53
|
+
|
|
54
|
+
</TabItem>
|
|
55
|
+
</Tabs>
|
|
56
|
+
|
|
57
|
+
## Examples
|
|
58
|
+
|
|
59
|
+
Remove a deleted container by ID.
|
|
60
|
+
|
|
61
|
+
```sh
|
|
62
|
+
m365 spe container recyclebinitem remove --id "b!ISJs1WRro0y0EWgkUYcktDa0mE8zSlFEqFzqRn70Zwp1CEtDEBZgQICPkRbil_5Z"
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Remove a deleted container by using its name and container type ID.
|
|
66
|
+
|
|
67
|
+
```sh
|
|
68
|
+
m365 spe container recyclebinitem remove --containerTypeId "91710488-5756-407f-9046-fbe5f0b4de73" --name "Invoices"
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Remove a deleted container by using its name and container type name.
|
|
72
|
+
|
|
73
|
+
```sh
|
|
74
|
+
m365 spe container recyclebinitem remove --containerTypeName "My container type name" --name "Invoices"
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## Response
|
|
78
|
+
|
|
79
|
+
The command won't return a response on success.
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import Global from '/docs/cmd/_global.mdx';
|
|
2
|
+
import Tabs from '@theme/Tabs';
|
|
3
|
+
import TabItem from '@theme/TabItem';
|
|
2
4
|
|
|
3
5
|
# spo file add
|
|
4
6
|
|
|
@@ -28,6 +30,12 @@ m365 spo file add [options]
|
|
|
28
30
|
`--checkOut [checkOut]`
|
|
29
31
|
: If versioning is enabled, this will check out the file first if it exists, upload the file, then check it in again.
|
|
30
32
|
|
|
33
|
+
`--overwrite [overwrite]`
|
|
34
|
+
: Overwrite the file if it already exists in the target folder. Possible values: `true`, `false`. Default is `true`.
|
|
35
|
+
|
|
36
|
+
`--fileName [fileName]`
|
|
37
|
+
: The name of the file in SharePoint after upload. If not specified, the name of the uploaded file will be used.
|
|
38
|
+
|
|
31
39
|
`--checkInComment [checkInComment]`
|
|
32
40
|
: Comment to set when checking the file in.
|
|
33
41
|
|
|
@@ -50,6 +58,25 @@ m365 spo file add [options]
|
|
|
50
58
|
|
|
51
59
|
This command allows using unknown properties. Each property corresponds to the list item field that should be set when uploading the file.
|
|
52
60
|
|
|
61
|
+
## Permissions
|
|
62
|
+
|
|
63
|
+
<Tabs>
|
|
64
|
+
<TabItem value="Delegated">
|
|
65
|
+
|
|
66
|
+
| Resource | Permissions |
|
|
67
|
+
|------------|----------------|
|
|
68
|
+
| SharePoint | AllSites.Write |
|
|
69
|
+
|
|
70
|
+
</TabItem>
|
|
71
|
+
<TabItem value="Application">
|
|
72
|
+
|
|
73
|
+
| Resource | Permissions |
|
|
74
|
+
|------------|---------------------|
|
|
75
|
+
| SharePoint | Sites.ReadWrite.All |
|
|
76
|
+
|
|
77
|
+
</TabItem>
|
|
78
|
+
</Tabs>
|
|
79
|
+
|
|
53
80
|
## Examples
|
|
54
81
|
|
|
55
82
|
Adds the specified file to the specified site in the specified folder.
|
|
@@ -70,6 +97,12 @@ Adds the specified file to the specified site in the specified folder specifying
|
|
|
70
97
|
m365 spo file add --webUrl https://contoso.sharepoint.com/sites/project-x --folder '/sites/project-x/Shared Documents' --path 'C:\MS365.jpg'
|
|
71
98
|
```
|
|
72
99
|
|
|
100
|
+
Uploads a file to SharePoint with a different name.
|
|
101
|
+
|
|
102
|
+
```sh
|
|
103
|
+
m365 spo file add --webUrl https://contoso.sharepoint.com/sites/project-x --folder 'Shared Documents' --path 'C:\MS365.jpg' --fileName 'MS365-New.jpg'
|
|
104
|
+
```
|
|
105
|
+
|
|
73
106
|
Adds the specified file to the specified site in the specified folder with specified content type.
|
|
74
107
|
|
|
75
108
|
```sh
|
|
@@ -156,7 +189,113 @@ m365 spo file add --webUrl https://contoso.sharepoint.com/sites/project-x --fold
|
|
|
156
189
|
|
|
157
190
|
## Response
|
|
158
191
|
|
|
159
|
-
|
|
192
|
+
<Tabs>
|
|
193
|
+
<TabItem value="JSON">
|
|
194
|
+
|
|
195
|
+
```json
|
|
196
|
+
{
|
|
197
|
+
"CheckInComment": "",
|
|
198
|
+
"CheckOutType": 2,
|
|
199
|
+
"ContentTag": "{56B8E3C8-8E8A-4600-B9E1-A63D27391799},2,5",
|
|
200
|
+
"CustomizedPageStatus": 0,
|
|
201
|
+
"ETag": "\"{56B8E3C8-8E8A-4600-B9E1-A63D27391799},2\"",
|
|
202
|
+
"Exists": true,
|
|
203
|
+
"ExistsAllowThrowForPolicyFailures": true,
|
|
204
|
+
"ExistsWithException": true,
|
|
205
|
+
"IrmEnabled": false,
|
|
206
|
+
"Length": "19555",
|
|
207
|
+
"Level": 1,
|
|
208
|
+
"LinkingUri": "https://contoso.sharepoint.com/sites/Finance/YearlyReports/Yearly%20report.xlsx?d=w56b8e3c88e8a4600b9e1a63d27391799",
|
|
209
|
+
"LinkingUrl": "https://contoso.sharepoint.com/sites/Finance/YearlyReports/Yearly report.xlsx?d=w56b8e3c88e8a4600b9e1a63d27391799",
|
|
210
|
+
"MajorVersion": 1,
|
|
211
|
+
"MinorVersion": 0,
|
|
212
|
+
"Name": "Yearly report.xlsx",
|
|
213
|
+
"ServerRelativeUrl": "/sites/Finance/YearlyReports/Yearly report.xlsx",
|
|
214
|
+
"TimeCreated": "2026-01-07T10:50:38Z",
|
|
215
|
+
"TimeLastModified": "2026-01-07T10:50:38Z",
|
|
216
|
+
"Title": "",
|
|
217
|
+
"UIVersion": 512,
|
|
218
|
+
"UIVersionLabel": "1.0",
|
|
219
|
+
"UniqueId": "56b8e3c8-8e8a-4600-b9e1-a63d27391799"
|
|
220
|
+
}
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
</TabItem>
|
|
224
|
+
<TabItem value="Text">
|
|
225
|
+
|
|
226
|
+
```text
|
|
227
|
+
CheckInComment :
|
|
228
|
+
CheckOutType : 2
|
|
229
|
+
ContentTag : {56B8E3C8-8E8A-4600-B9E1-A63D27391799},2,5
|
|
230
|
+
CustomizedPageStatus : 0
|
|
231
|
+
ETag : "{56B8E3C8-8E8A-4600-B9E1-A63D27391799},2"
|
|
232
|
+
Exists : true
|
|
233
|
+
ExistsAllowThrowForPolicyFailures: true
|
|
234
|
+
ExistsWithException : true
|
|
235
|
+
IrmEnabled : false
|
|
236
|
+
Length : 19555
|
|
237
|
+
Level : 1
|
|
238
|
+
LinkingUri : https://contoso.sharepoint.com/sites/Finance/YearlyReports/Yearly%20report.xlsx?d=w56b8e3c88e8a4600b9e1a63d27391799
|
|
239
|
+
LinkingUrl : https://contoso.sharepoint.com/sites/Finance/YearlyReports/Yearly report.xlsx?d=w56b8e3c88e8a4600b9e1a63d27391799
|
|
240
|
+
MajorVersion : 2
|
|
241
|
+
MinorVersion : 0
|
|
242
|
+
Name : Yearly report.xlsx
|
|
243
|
+
ServerRelativeUrl : /sites/Finance/YearlyReports/Yearly report.xlsx
|
|
244
|
+
TimeCreated : 2026-01-07T10:50:38Z
|
|
245
|
+
TimeLastModified : 2026-01-07T10:50:38Z
|
|
246
|
+
Title :
|
|
247
|
+
UIVersion : 512
|
|
248
|
+
UIVersionLabel : 1.0
|
|
249
|
+
UniqueId : 56b8e3c8-8e8a-4600-b9e1-a63d27391799
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
</TabItem>
|
|
253
|
+
<TabItem value="CSV">
|
|
254
|
+
|
|
255
|
+
```csv
|
|
256
|
+
CheckInComment,CheckOutType,ContentTag,CustomizedPageStatus,ETag,Exists,ExistsAllowThrowForPolicyFailures,ExistsWithException,IrmEnabled,Length,Level,LinkingUri,LinkingUrl,MajorVersion,MinorVersion,Name,ServerRelativeUrl,TimeCreated,TimeLastModified,Title,UIVersion,UIVersionLabel,UniqueId
|
|
257
|
+
,2,"{56B8E3C8-8E8A-4600-B9E1-A63D27391799},2,5",0,"""{56B8E3C8-8E8A-4600-B9E1-A63D27391799},2""",1,1,1,0,19555,1,https://contoso.sharepoint.com/sites/Finance/YearlyReports/Yearly%20report.xlsx?d=w56b8e3c88e8a4600b9e1a63d27391799,https://contoso.sharepoint.com/sites/Finance/YearlyReports/Yearly report.xlsx?d=w56b8e3c88e8a4600b9e1a63d27391799,3,0,Yearly report.xlsx,/sites/Finance/YearlyReports/Yearly report.xlsx,2026-01-07T10:50:38Z,2026-01-07T10:50:38Z,,512,1.0,56b8e3c8-8e8a-4600-b9e1-a63d27391799
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
</TabItem>
|
|
261
|
+
<TabItem value="Markdown">
|
|
262
|
+
|
|
263
|
+
```md
|
|
264
|
+
# spo file add --webUrl "https://contoso.sharepoint.com/sites/Finance" --folder "/YearlyReports" --path "C:\Yearly report.xlsx"
|
|
265
|
+
|
|
266
|
+
Date: 07/01/2026
|
|
267
|
+
|
|
268
|
+
## 56b8e3c8-8e8a-4600-b9e1-a63d27391799
|
|
269
|
+
|
|
270
|
+
Property | Value
|
|
271
|
+
---------|-------
|
|
272
|
+
CheckInComment |
|
|
273
|
+
CheckOutType | 2
|
|
274
|
+
ContentTag | {56B8E3C8-8E8A-4600-B9E1-A63D27391799},2,5
|
|
275
|
+
CustomizedPageStatus | 0
|
|
276
|
+
ETag | "{56B8E3C8-8E8A-4600-B9E1-A63D27391799},2"
|
|
277
|
+
Exists | true
|
|
278
|
+
ExistsAllowThrowForPolicyFailures | true
|
|
279
|
+
ExistsWithException | true
|
|
280
|
+
IrmEnabled | false
|
|
281
|
+
Length | 19555
|
|
282
|
+
Level | 1
|
|
283
|
+
LinkingUri | https://contoso.sharepoint.com/sites/Finance/YearlyReports/Yearly%20report.xlsx?d=w56b8e3c88e8a4600b9e1a63d27391799
|
|
284
|
+
LinkingUrl | https://contoso.sharepoint.com/sites/Finance/YearlyReports/Yearly report.xlsx?d=w56b8e3c88e8a4600b9e1a63d27391799
|
|
285
|
+
MajorVersion | 4
|
|
286
|
+
MinorVersion | 0
|
|
287
|
+
Name | Yearly report.xlsx
|
|
288
|
+
ServerRelativeUrl | /sites/Finance/YearlyReports/Yearly report.xlsx
|
|
289
|
+
TimeCreated | 2026-01-07T10:50:38Z
|
|
290
|
+
TimeLastModified | 2026-01-07T10:50:38Z
|
|
291
|
+
Title |
|
|
292
|
+
UIVersion | 512
|
|
293
|
+
UIVersionLabel | 1.0
|
|
294
|
+
UniqueId | 56b8e3c8-8e8a-4600-b9e1-a63d27391799
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
</TabItem>
|
|
298
|
+
</Tabs>
|
|
160
299
|
|
|
161
300
|
## More information
|
|
162
301
|
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import Global from '/docs/cmd/_global.mdx';
|
|
2
|
+
import Tabs from '@theme/Tabs';
|
|
3
|
+
import TabItem from '@theme/TabItem';
|
|
2
4
|
|
|
3
5
|
# spo page header set
|
|
4
6
|
|
|
@@ -40,11 +42,14 @@ m365 spo page header set [options]
|
|
|
40
42
|
`--textAlignment [textAlignment]`
|
|
41
43
|
: How to align text in the header. Allowed values `Center`, `Left`. Default `Left`.
|
|
42
44
|
|
|
43
|
-
`--showTopicHeader`
|
|
44
|
-
:
|
|
45
|
+
`--showTopicHeader [showTopicHeader]`
|
|
46
|
+
: Show the topic header. Valid values: `true`, `false`. Defaults to `false`.
|
|
45
47
|
|
|
46
|
-
`--showPublishDate`
|
|
47
|
-
:
|
|
48
|
+
`--showPublishDate [showPublishDate]`
|
|
49
|
+
: Show the publishing date. Valid values: `true`, `false`. Defaults to `false`.
|
|
50
|
+
|
|
51
|
+
`--showTimeToRead [showTimeToRead]`
|
|
52
|
+
: Show the estimated time to read the page. Valid values: `true`, `false`. Defaults to `false`.
|
|
48
53
|
|
|
49
54
|
`--topicHeader [topicHeader]`
|
|
50
55
|
: Text to show in the topic header, when `showTopicHeader` is set.
|
|
@@ -55,9 +60,24 @@ m365 spo page header set [options]
|
|
|
55
60
|
|
|
56
61
|
<Global />
|
|
57
62
|
|
|
58
|
-
##
|
|
63
|
+
## Permissions
|
|
64
|
+
|
|
65
|
+
<Tabs>
|
|
66
|
+
<TabItem value="Delegated">
|
|
67
|
+
|
|
68
|
+
| Resource | Permissions |
|
|
69
|
+
|------------|----------------|
|
|
70
|
+
| SharePoint | AllSites.Write |
|
|
71
|
+
|
|
72
|
+
</TabItem>
|
|
73
|
+
<TabItem value="Application">
|
|
74
|
+
|
|
75
|
+
| Resource | Permissions |
|
|
76
|
+
|------------|---------------------|
|
|
77
|
+
| SharePoint | Sites.ReadWrite.All |
|
|
59
78
|
|
|
60
|
-
|
|
79
|
+
</TabItem>
|
|
80
|
+
</Tabs>
|
|
61
81
|
|
|
62
82
|
## Examples
|
|
63
83
|
|
|
@@ -79,10 +99,10 @@ Use the specified image focused on the given coordinates in the page header
|
|
|
79
99
|
m365 spo page header set --webUrl https://contoso.sharepoint.com/sites/team-a --pageName home.aspx --type Custom --imageUrl /sites/team-a/SiteAssets/hero.jpg --altText 'Sunset over the ocean' --translateX 42.3837520042758 --translateY 56.4285714285714
|
|
80
100
|
```
|
|
81
101
|
|
|
82
|
-
Center the page title in the header and show the publishing date
|
|
102
|
+
Center the page title in the header and show the publishing date and time to read
|
|
83
103
|
|
|
84
104
|
```sh
|
|
85
|
-
m365 spo page header set --webUrl https://contoso.sharepoint.com/sites/team-a --pageName home.aspx --textAlignment Center --showPublishDate
|
|
105
|
+
m365 spo page header set --webUrl https://contoso.sharepoint.com/sites/team-a --pageName home.aspx --textAlignment Center --showPublishDate true --showTimeToRead true
|
|
86
106
|
```
|
|
87
107
|
|
|
88
108
|
## Response
|