Skip to content

Commit 6bfa732

Browse files
Improve docs for Add-PnPPage and add a sample for Connect-PnPOnline (#4485)
* Improve documentation Clarifies how the commandlet works, removes one extra PagePromoteTyåpe value, and improves consistency of the documentation file. * Improve documentation Fix numbering of samples and add a new one on how to use Credential Manager for credentials --------- Co-authored-by: Gautam Sheth <gautamdsheth@outlook.com>
1 parent f3b8aef commit 6bfa732

File tree

2 files changed

+21
-12
lines changed

2 files changed

+21
-12
lines changed

documentation/Add-PnPPage.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Add-PnPPage [-Name] <String> [-LayoutType <PageLayoutType>]
2323
```
2424

2525
## DESCRIPTION
26-
Creates a new page. The page will be located inside the Site Pages library of the site currently connected to.
26+
Creates a new page. The page will be located inside the Site Pages library of the site currently connected to. If the library does not exist yet, tries to ensure it is created.
2727

2828
## EXAMPLES
2929

@@ -32,21 +32,21 @@ Creates a new page. The page will be located inside the Site Pages library of th
3232
Add-PnPPage -Name "NewPage"
3333
```
3434

35-
Creates a new page named 'NewPage'
35+
Creates a new page named 'NewPage'. The resulting file will accordingly be named 'NewPage.aspx'. If a file with that name already exists, executing the commandlet will fail.
3636

3737
### EXAMPLE 2
3838
```powershell
3939
Add-PnPPage -Name "NewPage" -Title "Welcome to my page"
4040
```
4141

42-
Creates a new page NewPage.aspx with the title as provided
42+
Creates a new page NewPage.aspx with the title as provided.
4343

4444
### EXAMPLE 3
4545
```powershell
4646
Add-PnPPage -Name "NewPage" -ContentType "MyPageContentType"
4747
```
4848

49-
Creates a new page named 'NewPage' and sets the content type to the content type specified
49+
Creates a new page named 'NewPage' and sets the content type to the content type specified.
5050

5151
### EXAMPLE 4
5252
```powershell
@@ -67,14 +67,14 @@ Creates a new page named 'NewPage' under 'Folder' folder and saves as a template
6767
Add-PnPPage -Name "NewPage" -HeaderLayoutType ColorBlock
6868
```
6969

70-
Creates a new page named 'NewPage' using the ColorBlock header layout
70+
Creates a new page named 'NewPage' using the ColorBlock header layout.
7171

7272
### EXAMPLE 7
7373
```powershell
7474
Add-PnPPage -Name "NewPage" Article -ScheduledPublishDate (Get-Date).AddHours(1)
7575
```
7676

77-
Creates a new page named 'NewPage' using the article layout and schedule it to be published in 1 hour from now
77+
Creates a new page named 'NewPage' using the article layout and schedule it to be published in 1 hour from now.
7878

7979
### EXAMPLE 8
8080
```powershell
@@ -116,7 +116,7 @@ Accept wildcard characters: False
116116
```
117117
118118
### -CommentsEnabled
119-
Enables or Disables the comments on the page
119+
Enables or Disables the comments on the page.
120120
121121
```yaml
122122
Type: SwitchParameter
@@ -144,7 +144,7 @@ Accept wildcard characters: False
144144
```
145145
146146
### -HeaderLayoutType
147-
Type of layout used for the header
147+
Type of layout used for the header.
148148
149149
```yaml
150150
Type: PageHeaderLayoutType
@@ -188,12 +188,12 @@ Accept wildcard characters: False
188188
```
189189
190190
### -PromoteAs
191-
Allows to promote the page for a specific purpose (HomePage | NewsPage)
191+
Allows to promote the page for a specific purpose (HomePage | NewsPage).
192192
193193
```yaml
194194
Type: PagePromoteType
195195
Parameter Sets: (All)
196-
Accepted values: None, HomePage, NewsArticle, Template
196+
Accepted values: None, HomePage, NewsArticle
197197

198198
Required: False
199199
Position: Named
@@ -231,7 +231,7 @@ Accept wildcard characters: False
231231
```
232232
233233
### -Translate
234-
Creates multilingual pages for all the languages specified in the site collection
234+
Creates multilingual pages for all the languages specified in the site collection.
235235
236236
```yaml
237237
Type: SwitchParameter

documentation/Connect-PnPOnline.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ Connects to the Azure AD with WAM (aka native Windows authentication prompt), ac
282282

283283
WAM is a more secure & faster way of authenticating in Windows OS. It supports Windows Hello, FIDO keys , conditional access policies and more.
284284

285-
### EXAMPLE 9
285+
### EXAMPLE 19
286286
```powershell
287287
$keyStorageflags = [System.Security.Cryptography.X509Certificates.X509KeyStorageFlags]::MachineKeySet -bor [System.Security.Cryptography.X509Certificates.X509KeyStorageFlags]::PersistKeySet
288288
@@ -294,6 +294,15 @@ See [Security App-only EntraId guidance](https://learn.microsoft.com/sharepoint/
294294

295295
See [X509 key storage flags](https://learn.microsoft.com/dotnet/api/system.security.cryptography.x509certificates.x509keystorageflags) for information on how to configure key storage when creating the certificate.
296296

297+
### EXAMPLE 20
298+
```powershell
299+
Connect-PnPOnline -Url "https://contoso.sharepoint.com" -Credentials "https://contoso.sharepoint.com"
300+
```
301+
302+
Connect to SharePoint using Credentials (username and password) from Credential Manager (Windows) or Keychain (Mac) with the specified name to use to authenticate.
303+
304+
On Windows, this entry needs to be under "Generic Credentials".
305+
297306
## PARAMETERS
298307

299308
### -AccessToken

0 commit comments

Comments
 (0)