Skip to content

Commit f18e1f1

Browse files
authored
Merge pull request #3001 from pnp/feature/fix-missing-tilds
Feature: improve docs , copy to clipboard for some files
2 parents d5594f4 + fa2e0a3 commit f18e1f1

File tree

6 files changed

+37
-37
lines changed

6 files changed

+37
-37
lines changed

documentation/Connect-PnPOnline.md

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -15,51 +15,51 @@ Connect to a SharePoint site
1515
## SYNTAX
1616

1717
### Credentials (Default)
18-
```
18+
```powershell
1919
Connect-PnPOnline [-ReturnConnection] [-Url] <String> [-Credentials <CredentialPipeBind>] [-CurrentCredentials]
2020
[-CreateDrive] [-DriveName <String>] [-ClientId <String>] [-RedirectUri <String>]
2121
[-AzureEnvironment <AzureEnvironment>] [-TenantAdminUrl <String>]
2222
[-TransformationOnPrem] [-ValidateConnection] [-Connection <PnPConnection>]
2323
```
2424

2525
### SharePoint ACS (Legacy) App Only
26-
```
26+
```powershell
2727
Connect-PnPOnline [-ReturnConnection] [-Url] <String> [-Realm <String>] -ClientSecret <String> [-CreateDrive]
2828
[-DriveName <String>] -ClientId <String> [-AzureEnvironment <AzureEnvironment>] [-TenantAdminUrl <String>]
2929
[-ValidateConnection] [-Connection <PnPConnection>]
3030
```
3131

3232
### App-Only with Azure Active Directory
33-
```
33+
```powershell
3434
Connect-PnPOnline [-ReturnConnection] [-Url] <String> [-CreateDrive] [-DriveName <String>] -ClientId <String>
3535
-Tenant <String> [-CertificatePath <String>] [-CertificateBase64Encoded <String>]
3636
[-CertificatePassword <SecureString>] [-AzureEnvironment <AzureEnvironment>] [-TenantAdminUrl <String>]
3737
[-ValidateConnection] [-Connection <PnPConnection>]
3838
```
3939

4040
### App-Only with Azure Active Directory using a certificate from the Windows Certificate Management Store by thumbprint
41-
```
41+
```powershell
4242
Connect-PnPOnline [-ReturnConnection] [-Url] <String> [-CreateDrive] [-DriveName <String>] -ClientId <String>
4343
-Tenant <String> -Thumbprint <String> [-AzureEnvironment <AzureEnvironment>] [-TenantAdminUrl <String>]
4444
[-ValidateConnection] [-Connection <PnPConnection>]
4545
```
4646

4747
### PnP Management Shell / DeviceLogin
48-
```
48+
```powershell
4949
Connect-PnPOnline [-ReturnConnection] [-Url] <String> [-CreateDrive] [-DriveName <String>] [-DeviceLogin]
5050
[-LaunchBrowser] [-ClientId <String>] [-AzureEnvironment <AzureEnvironment>]
5151
[-ValidateConnection] [-Connection <PnPConnection>]
5252
```
5353

5454
### Web Login for Multi Factor Authentication
55-
```
55+
```powershell
5656
Connect-PnPOnline [-ReturnConnection] [-Url] <String> [-CreateDrive] [-DriveName <String>]
5757
[-TenantAdminUrl <String>] [-UseWebLogin] [-ForceAuthentication]
5858
[-ValidateConnection]
5959
```
6060

6161
### Interactive for Multi Factor Authentication
62-
```
62+
```powershell
6363
Connect-PnPOnline -Interactive [-ReturnConnection] -Url <String> [-CreateDrive] [-DriveName <String>] [-LaunchBrowser]
6464
[-ClientId <String>] [-AzureEnvironment <AzureEnvironment>] [-TenantAdminUrl <String>] [-ForceAuthentication] [-ValidateConnection] [-Connection <PnPConnection>]
6565
```
@@ -70,32 +70,32 @@ Connect-PnPOnline -Url <String> -TransformationOnPrem [-CurrentCredential]
7070
```
7171

7272
### Access Token
73-
```
73+
```powershell
7474
Connect-PnPOnline -Url <String> -AccessToken <String> [-AzureEnvironment <AzureEnvironment>] [-ReturnConnection]
7575
```
7676

7777
### System Assigned Managed Identity
78-
```
78+
```powershell
7979
Connect-PnPOnline [-Url <String>] -ManagedIdentity [-ReturnConnection]
8080
```
8181

8282
### User Assigned Managed Identity by Client Id
83-
```
83+
```powershell
8484
Connect-PnPOnline [-Url <String>] -ManagedIdentity -UserAssignedManagedIdentityClientId <String> [-ReturnConnection]
8585
```
8686

8787
### User Assigned Managed Identity by Principal Id
88-
```
88+
```powershell
8989
Connect-PnPOnline [-Url <String>] -ManagedIdentity -UserAssignedManagedIdentityObjectId <String> [-ReturnConnection]
9090
```
9191

9292
### User Assigned Managed Identity by Azure Resource Id
93-
```
93+
```powershell
9494
Connect-PnPOnline [-Url <String>] -ManagedIdentity -UserAssignedManagedIdentityAzureResourceId <String> [-ReturnConnection]
9595
```
9696

9797
### Environment Variable
98-
```
98+
```powershell
9999
Connect-PnPOnline [-ReturnConnection] [-Url] <String> [-EnvironmentVariable] [-CurrentCredentials]
100100
[-CreateDrive] [-DriveName <String>] [-RedirectUri <String>]
101101
[-AzureEnvironment <AzureEnvironment>] [-TenantAdminUrl <String>]
@@ -109,45 +109,45 @@ See https://pnp.github.io/powershell/articles/connecting.html for more informati
109109
## EXAMPLES
110110

111111
### EXAMPLE 1
112-
```
112+
```powershell
113113
Connect-PnPOnline -Url "contoso.sharepoint.com"
114114
```
115115

116116
Connect to SharePoint prompting for the username and password.
117117
When a generic credential is added to the Windows Credential Manager with https://contoso.sharepoint.com, PowerShell will not prompt for username and password and use those stored credentials instead.
118118

119119
### EXAMPLE 2
120-
```
120+
```powershell
121121
Connect-PnPOnline -Url "contoso.sharepoint.com" -Credentials (Get-Credential)
122122
```
123123

124124
Connect to SharePoint prompting for the username and password to use to authenticate
125125

126126
### EXAMPLE 3
127-
```
127+
```powershell
128128
Connect-PnPOnline -Url "contoso.sharepoint.de" -ClientId 344b8aab-389c-4e4a-8fa1-4c1ae2c0a60d -ClientSecret $clientSecret
129129
```
130130

131131
This will authenticate you to the site using Legacy ACS authentication
132132

133133
### EXAMPLE 4
134-
```
134+
```powershell
135135
Connect-PnPOnline -Url "contoso.sharepoint.com" -DeviceLogin
136136
```
137137

138138
This will authenticate you using the PnP Management Shell Multi-Tenant application.
139139
A browser window will have to be opened where you have to enter a code that is shown in your PowerShell window.
140140

141141
### EXAMPLE 5
142-
```
142+
```powershell
143143
Connect-PnPOnline -Url "contoso.sharepoint.com" -DeviceLogin -LaunchBrowser
144144
```
145145

146146
This will authenticate you using the PnP Management Shell Multi-Tenant application.
147147
A browser window will automatically open and the code you need to enter will be automatically copied to your clipboard.
148148

149149
### EXAMPLE 6
150-
```
150+
```powershell
151151
$password = (ConvertTo-SecureString -AsPlainText 'myprivatekeypassword' -Force)
152152
Connect-PnPOnline -Url "contoso.sharepoint.com" -ClientId 6c5c98c7-e05a-4a0f-bcfa-0cfc65aa1f28 -CertificatePath 'c:\mycertificate.pfx' -CertificatePassword $password -Tenant 'contoso.onmicrosoft.com'
153153
```
@@ -156,7 +156,7 @@ Connects using an Azure Active Directory registered application using a locally
156156
See https://learn.microsoft.com/sharepoint/dev/solution-guidance/security-apponly-azuread for a sample on how to get started.
157157

158158
### EXAMPLE 7
159-
```
159+
```powershell
160160
Connect-PnPOnline -Url "contoso.sharepoint.com" -ClientId 6c5c98c7-e05a-4a0f-bcfa-0cfc65aa1f28 -Tenant 'contoso.onmicrosoft.com' -Thumbprint 34CFAA860E5FB8C44335A38A097C1E41EEA206AA
161161
```
162162

@@ -165,15 +165,15 @@ See https://github.com/SharePoint/PnP-PowerShell/tree/master/Samples/SharePoint.
165165
Ensure you have imported the private key certificate, typically the .pfx file, into the Windows Certificate Store for the certificate with the provided thumbprint.
166166

167167
### EXAMPLE 8
168-
```
168+
```powershell
169169
Connect-PnPOnline -Url "contoso.sharepoint.com" -ClientId 6c5c98c7-e05a-4a0f-bcfa-0cfc65aa1f28 -CertificateBase64Encoded $base64encodedstring -Tenant 'contoso.onmicrosoft.com'
170170
```
171171

172172
Connects using an Azure Active Directory registered application using a certificate with a private key that has been base64 encoded.
173173
See https://learn.microsoft.com/sharepoint/dev/solution-guidance/security-apponly-azuread for a sample on how to get started.
174174

175175
### EXAMPLE 9
176-
```
176+
```powershell
177177
Connect-PnPOnline -Url "contoso.sharepoint.com" -UseWebLogin
178178
```
179179

@@ -188,15 +188,15 @@ Use -ForceAuthentication to reset the authentication cookies and force a new log
188188
See example 10 for a full support for interactive logins using MFA and the ability to acquire Graph tokens.
189189

190190
### EXAMPLE 10
191-
```
191+
```powershell
192192
Connect-PnPOnline -Url "contoso.sharepoint.com" -Interactive
193193
```
194194

195195
Connects to the Azure AD, acquires an access token and allows PnP PowerShell to access both SharePoint and the Microsoft Graph.
196196
By default it will use the PnP Management Shell multi-tenant application behind the scenes, so make sure to run \`Register-PnPManagementShellAccess\` first.
197197

198198
### EXAMPLE 11
199-
```
199+
```powershell
200200
Connect-PnPOnline -Url "https://portal.contoso.com" -TransformationOnPrem -CurrentCredential
201201
```
202202

@@ -206,38 +206,38 @@ Although other PnP cmdlets might work as well, they're officially not supported
206206
See http://aka.ms/sharepoint/modernization/pages for more details on page transformation.
207207

208208
### EXAMPLE 12
209-
```
209+
```powershell
210210
Connect-PnPOnline -Url contoso.sharepoint.com -ManagedIdentity
211211
Get-PnPTeamsTeam
212212
```
213213

214214
Connects using a system assigned managed identity to Microsoft Graph. Using this way of connecting only works with environments that support managed identities: Azure Functions, Azure Automation Runbooks and the Azure Cloud Shell. Read up on [this article](https://pnp.github.io/powershell/articles/azurefunctions.html#by-using-a-managed-identity) how it can be used.
215215

216216
### EXAMPLE 13
217-
```
217+
```powershell
218218
Connect-PnPOnline -Url contoso.sharepoint.com -ManagedIdentity -UserAssignedManagedIdentityObjectId 363c1b31-6872-47fd-a616-574d3aec2a51
219219
Get-PnPList
220220
```
221221

222222
Connects using an user assigned managed identity with object/principal ID 363c1b31-6872-47fd-a616-574d3aec2a51 to SharePoint Online. Using this way of connecting only works with environments that support managed identities: Azure Functions, Azure Automation Runbooks and the Azure Cloud Shell. Read up on [this article](https://pnp.github.io/powershell/articles/azurefunctions.html#by-using-a-managed-identity) how it can be used.
223223

224224
### EXAMPLE 14
225-
```
225+
```powershell
226226
Connect-PnPOnline -Url contoso.sharepoint.com -AccessToken $token
227227
```
228228

229229
This method assumes you have acquired a valid OAuth2 access token from Azure AD with the correct audience and permissions set.
230230
Using this method PnP PowerShell will not acquire tokens dynamically and if the token expires (typically after 1 hour) cmdlets will fail to work using this method.
231231

232232
### EXAMPLE 15
233-
```
233+
```powershell
234234
Connect-PnPOnline -Url contoso.sharepoint.com -EnvironmentVariable -Tenant 'contoso.onmicrosoft.com'
235235
```
236236

237237
This example uses the `AZURE_CLIENT_CERTIFICATE_PATH` and `AZURE_CLIENT_CERTIFICATE_PASSWORD` environment variable values to authenticate. The `AZURE_CLIENT_ID` environment variable must be present and `Tenant` parameter value must be provided.
238238

239239
### EXAMPLE 16
240-
```
240+
```powershell
241241
Connect-PnPOnline -Url contoso.sharepoint.com -EnvironmentVariable
242242
```
243243

documentation/Export-PnPFlow.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@ Exports a Microsoft Power Automate Flow
2020
## SYNTAX
2121

2222
### As ZIP Package
23-
```
23+
```powershell
2424
Export-PnPFlow -Environment <PowerAutomateEnvironmentPipeBind> -Identity <PowerAutomateFlowPipeBind>
2525
[-AsZipPackage] [-PackageDisplayName <String>] [-PackageDescription <String>] [-PackageCreatedBy <String>]
2626
[-PackageSourceEnvironment <String>] [-OutPath <String>] [-Force] [-Connection <PnPConnection>]
2727
[<CommonParameters>]
2828
```
2929

3030
### As Json
31-
```
31+
```powershell
3232
Export-PnPFlow -Environment <PowerAutomateEnvironmentPipeBind> -Identity <PowerAutomateFlowPipeBind>
3333
[-Connection <PnPConnection>] [<CommonParameters>]
3434
```

documentation/Get-PnPAzureADApp.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ Returns Azure AD App registrations
2020
## SYNTAX
2121

2222
### Filter
23-
```
23+
```powershell
2424
Get-PnPAzureADApp [-Identity <AzureADAppPipeBind>]
2525
```
2626

2727
### Identity (Default)
28-
```
28+
```powershell
2929
Get-PnPAzureADApp -Filter <string>
3030
```
3131

pages/articles/buildingdocker.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ docker run --rm -it -v %cd%\pages:C:\workplace pnp.powershell-pages-build powers
3737

3838
## Clean documentation
3939

40-
```
40+
```bat
4141
rmdir /s /q pages\_site
4242
rmdir /s /q pages\obj
4343
```

pages/articles/docker.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ You can try using m365pnp/powershell Docker containers online, without installin
2222

2323
5. Run in the online console:
2424

25-
```
25+
```powershell
2626
docker run --rm -it m365pnp/powershell
2727
```
2828

pages/articles/installation.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ Install-Module PnP.PowerShell -Scope CurrentUser -AllowPrerelease -SkipPublisher
2222

2323
To use PnP.PowerShell in a Windows container:
2424

25-
```
25+
```powershell
2626
docker run -it m365pnp/powershell:1.10.0-nanoserver-1809
2727
```
2828

2929
To use PnP.PowerShell in a Linux container:
3030

31-
```
31+
```powershell
3232
docker run -it m365pnp/powershell
3333
```
3434

0 commit comments

Comments
 (0)