@pnp/cli-microsoft365 11.4.0-beta.40f818c → 11.4.0-beta.f54089d
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/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/utils/spo.js +1 -2
- 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/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 &&
|
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
|
},
|
|
@@ -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
|
|
@@ -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 set
|
|
4
6
|
|
|
@@ -20,16 +22,19 @@ m365 spo page set [options]
|
|
|
20
22
|
: URL of the site where the page to update is located.
|
|
21
23
|
|
|
22
24
|
`-l, --layoutType [layoutType]`
|
|
23
|
-
: Layout of the page. Allowed values `Article`, `Home`, `SingleWebPartAppPage`, `RepostPage`, `HeaderlessSearchResults`, `Spaces`, `Topic`.
|
|
25
|
+
: Layout of the page. Allowed values: `Article`, `Home`, `SingleWebPartAppPage`, `RepostPage`, `HeaderlessSearchResults`, `Spaces`, `Topic`.
|
|
24
26
|
|
|
25
27
|
`-p, --promoteAs [promoteAs]`
|
|
26
|
-
: Update the page purpose. Allowed values `HomePage`, `NewsPage`, `Template`.
|
|
28
|
+
: Update the page purpose. Allowed values: `HomePage`, `NewsPage`, `Template`.
|
|
27
29
|
|
|
28
30
|
`--demoteFrom [demoteFrom]`
|
|
29
|
-
: Update the page purpose back to a regular article. Allowed values `NewsPage`.
|
|
31
|
+
: Update the page purpose back to a regular article. Allowed values: `NewsPage`.
|
|
30
32
|
|
|
31
33
|
`--commentsEnabled [commentsEnabled]`
|
|
32
|
-
: Set to `true`, to enable comments on the page. Allowed values `true`, `false`.
|
|
34
|
+
: Set to `true`, to enable comments on the page. Allowed values: `true`, `false`.
|
|
35
|
+
|
|
36
|
+
`--isRetired [isRetired]`
|
|
37
|
+
: Marks the page as retired, showing a message that the page may be out of date. Allowed values: `true`, `false`.
|
|
33
38
|
|
|
34
39
|
`--publish`
|
|
35
40
|
: Set to publish the page.
|
|
@@ -69,6 +74,25 @@ When using the `--content` option it's possible to enter a JSON string. In Power
|
|
|
69
74
|
|
|
70
75
|
:::
|
|
71
76
|
|
|
77
|
+
## Permissions
|
|
78
|
+
|
|
79
|
+
<Tabs>
|
|
80
|
+
<TabItem value="Delegated">
|
|
81
|
+
|
|
82
|
+
| Resource | Permissions |
|
|
83
|
+
|------------|----------------|
|
|
84
|
+
| SharePoint | AllSites.Write |
|
|
85
|
+
|
|
86
|
+
</TabItem>
|
|
87
|
+
<TabItem value="Application">
|
|
88
|
+
|
|
89
|
+
| Resource | Permissions |
|
|
90
|
+
|------------|---------------------|
|
|
91
|
+
| SharePoint | Sites.ReadWrite.All |
|
|
92
|
+
|
|
93
|
+
</TabItem>
|
|
94
|
+
</Tabs>
|
|
95
|
+
|
|
72
96
|
## Examples
|
|
73
97
|
|
|
74
98
|
Change the layout of the existing page to _Article_
|
|
@@ -89,7 +113,7 @@ Promote the existing article page as a template
|
|
|
89
113
|
m365 spo page set --name page.aspx --webUrl https://contoso.sharepoint.com/sites/a-team --promoteAs Template
|
|
90
114
|
```
|
|
91
115
|
|
|
92
|
-
Demote the existing
|
|
116
|
+
Demote the existing news page
|
|
93
117
|
|
|
94
118
|
```sh
|
|
95
119
|
m365 spo page set --name page.aspx --webUrl https://contoso.sharepoint.com/sites/a-team --demoteFrom NewsPage
|
|
@@ -119,6 +143,12 @@ Set page description
|
|
|
119
143
|
m365 spo page set --name page.aspx --webUrl https://contoso.sharepoint.com/sites/a-team --description "Description to add for the page"
|
|
120
144
|
```
|
|
121
145
|
|
|
146
|
+
Marks a page as retired
|
|
147
|
+
|
|
148
|
+
```sh
|
|
149
|
+
m365 spo page set --name page.aspx --webUrl https://contoso.sharepoint.com/sites/a-team --isRetired true
|
|
150
|
+
```
|
|
151
|
+
|
|
122
152
|
Set page content
|
|
123
153
|
|
|
124
154
|
```sh
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pnp/cli-microsoft365",
|
|
3
|
-
"version": "11.4.0-beta.
|
|
3
|
+
"version": "11.4.0-beta.f54089d",
|
|
4
4
|
"description": "Manage Microsoft 365 and SharePoint Framework projects on any platform",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "./dist/api.js",
|
|
@@ -147,6 +147,7 @@
|
|
|
147
147
|
"De Cleyre, Nico <nico.de.cleyre@gmail.com>",
|
|
148
148
|
"Deshpande, Vardhaman <vardhaman.rd@gmail.com>",
|
|
149
149
|
"Dojcsák, János <dojcsak.janos@gmail.com>",
|
|
150
|
+
"Druzhkina, Antanina <totora246@gmail.com>",
|
|
150
151
|
"Dyjas, Robert <15113729+robdy@users.noreply.github.com>",
|
|
151
152
|
"Faleel, Mohamed Ashiq <ashiqf@gmail.com>",
|
|
152
153
|
"Flores, Gaston <gaston.flrs@gmail.com>",
|