@pnp/cli-microsoft365 11.4.0-beta.312ca0b → 11.4.0-beta.37c2235

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.
@@ -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
- The command won't return a response on success.
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
- : Set, to show the topic header.
45
+ `--showTopicHeader [showTopicHeader]`
46
+ : Show the topic header. Valid values: `true`, `false`. Defaults to `false`.
45
47
 
46
- `--showPublishDate`
47
- : Set, to show the publishing date.
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
- ## Remarks
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
- If the specified `name` doesn't refer to an existing modern page, you will get a `File doesn't exists` error.
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 newspage
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
@@ -16,11 +16,33 @@ m365 teams chat message list [options]
16
16
 
17
17
  ```md definition-list
18
18
  `-i, --chatId <chatId>`
19
- : The ID of the chat conversation
19
+ : The ID of the chat conversation.
20
+
21
+ `--endDateTime [endDateTime]`
22
+ : Time indicating the exclusive end of a time range when the message was created.
20
23
  ```
21
24
 
22
25
  <Global />
23
26
 
27
+ ## Permissions
28
+
29
+ <Tabs>
30
+ <TabItem value="Delegated">
31
+
32
+ | Resource | Permissions |
33
+ |-----------------|------------------|
34
+ | Microsoft Graph | ChatMessage.Read |
35
+
36
+ </TabItem>
37
+ <TabItem value="Application">
38
+
39
+ | Resource | Permissions |
40
+ |-----------------|----------------------|
41
+ | Microsoft Graph | ChatMessage.Read.All |
42
+
43
+ </TabItem>
44
+ </Tabs>
45
+
24
46
  ## Examples
25
47
 
26
48
  List the messages from a Microsoft Teams chat conversation
@@ -29,6 +51,12 @@ List the messages from a Microsoft Teams chat conversation
29
51
  m365 teams chat message list --chatId 19:2da4c29f6d7041eca70b638b43d45437@thread.v2
30
52
  ```
31
53
 
54
+ List messages from a Microsoft Teams chat conversation created before November 1, 2022
55
+
56
+ ```sh
57
+ m365 teams chat message list --chatId 19:2da4c29f6d7041eca70b638b43d45437@thread.v2 --endDateTime 2022-11-01T00:00:00Z
58
+ ```
59
+
32
60
  ## Response
33
61
 
34
62
  <Tabs>
@@ -79,17 +107,17 @@ m365 teams chat message list --chatId 19:2da4c29f6d7041eca70b638b43d45437@thread
79
107
  <TabItem value="Text">
80
108
 
81
109
  ```text
82
- id shortBody
83
- ------------- -------------------------
84
- 1667653590582 <p>Hello world</p>
110
+ id createdDateTime shortBody
111
+ ------------- ------------------------ ------------------
112
+ 1667653590582 2022-11-05T13:06:30.582Z <p>Hello world</p>
85
113
  ```
86
114
 
87
115
  </TabItem>
88
116
  <TabItem value="CSV">
89
117
 
90
118
  ```csv
91
- id,shortBody
92
- 1667653590582,<p>Hello world</p>
119
+ id,createdDateTime,shortBody
120
+ 1667653590582,2022-11-05T13:06:30.582Z,<p>Hello world</p>
93
121
  ```
94
122
 
95
123
  </TabItem>
@@ -118,4 +146,3 @@ m365 teams chat message list --chatId 19:2da4c29f6d7041eca70b638b43d45437@thread
118
146
 
119
147
  </TabItem>
120
148
  </Tabs>
121
-
@@ -1,3 +1,5 @@
1
+ import Tabs from '@theme/Tabs';
2
+ import TabItem from '@theme/TabItem';
1
3
  import Global from '/docs/cmd/_global.mdx';
2
4
 
3
5
  # teams chat message send
@@ -24,6 +26,9 @@ m365 teams chat message send [options]
24
26
 
25
27
  `-m, --message <message>`
26
28
  : The message to send
29
+
30
+ `--contentType [contentType]`
31
+ : The content type of the message. Allowed values are `text` and `html`. Default is `text`.
27
32
  ```
28
33
 
29
34
  <Global />
@@ -32,12 +37,29 @@ m365 teams chat message send [options]
32
37
 
33
38
  A new chat conversation will be created if no existing conversation with the participants specified with emails is found.
34
39
 
40
+ ## Permissions
41
+
42
+ <Tabs>
43
+ <TabItem value="Delegated">
44
+
45
+ | Resource | Permissions |
46
+ |-----------------|-----------------------------|
47
+ | Microsoft Graph | Chat.Read, ChatMessage.Send |
48
+
49
+ </TabItem>
50
+ <TabItem value="Application">
51
+
52
+ This command does not support application permissions.
53
+
54
+ </TabItem>
55
+ </Tabs>
56
+
35
57
  ## Examples
36
58
 
37
59
  Send a message to a Microsoft Teams chat conversation by id
38
60
 
39
61
  ```sh
40
- m365 teams chat message send --chatId 19:2da4c29f6d7041eca70b638b43d45437@thread.v2 --message "Welcome to Teams"
62
+ m365 teams chat message send --chatId 19:2da4c29f6d7041eca70b638b43d45437@thread.v2 --message "<b>Welcome</b> to Teams" --contentType html
41
63
  ```
42
64
 
43
65
  Send a message to a single person