Skip to content
This repository was archived by the owner on Jan 19, 2021. It is now read-only.

Commit dca6e98

Browse files
committed
Merge pull request #144 from erwinvanhunen/dev
Small update to contribution guide
2 parents 33bb584 + 3fb115f commit dca6e98

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

CONTRIBUTING.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ c:\[YOUR REPO FOLDER]\PnP-PowerShell
4242
The reason for this is that the PnP-PowerShell library will have references to the release and debug builds of the PnP-Sites-Core library.
4343

4444
A few notes:
45-
###Every new cmdlet should provide help and examples###
45+
###Every new cmdlet should provide help and examples
4646
As documentation is autogenerated by building the solution, make sure that you include both help and examples, alike
4747

4848
```csharp
@@ -55,17 +55,19 @@ As documentation is autogenerated by building the solution, make sure that you i
5555
{
5656
}
5757
```
58-
###Most cmdlets will extend SPOWebCmdlet which provides a few helper objects for you to use, like SelectedWeb and ClientContext###
58+
###Most cmdlets will extend SPOWebCmdlet which provides a few helper objects for you to use, like SelectedWeb and ClientContext
5959
As most cmdlets are 'web sensitive' (e.g. you can specify a -Web parameter to point to a different subweb), make sure that you use the correct ClientContext. When a user specifies the -Web parameter
6060
in a cmdlet that extens SPOWebCmdlet, the cmdlet will switch it's internal context to that web, reusing credentials. It is important to use the right context, and the easiest way to do that is to use
6161

6262
```csharp
6363
var context = SelectedWeb.Context;
6464
```
65-
###Cmdlets will have to work both on-premises and in the cloud###
65+
###Cmdlets will have to work both on-premises and in the cloud
6666
You can use preprocessor variables ("CLIENTSDKV15" and "CLIENTSDKV16") to build different cmdlets for the different targets. In cases where it is not possible to provide functionality for either the
6767
cloud or on-premises, make sure to remove the full cmdlet from the compiled solution by having #IF(!CLIENTSDKV15) or #IF(CLIENTSDKV15) as the _first line of the cmdlet, before using statements.
68-
Make the last line, after all code * The verb of a cmdlet (get-, add-, etc.) should follow acceptable cmdlet standards and should be part of one of the built in verbs classes (VerbsCommon, VerbsData, etc.):
68+
69+
See the following example
70+
6971

7072
```csharp
7173
#if !CLIENTSDKV15
@@ -80,6 +82,10 @@ public class MyCmdlet : SPOWebCmdlet
8082

8183
If only parts of a cmdlet require different behaviour based upon the different version of the SDK, you are recommended to use the #CLIENTSDKV15 preprocessor variable throughout your code to exclude or include certain code.
8284

85+
###Cmdlets will have to use common verbs
86+
87+
The verb of a cmdlet (get-, add-, etc.) should follow acceptable cmdlet standards and should be part of one of the built in verbs classes (VerbsCommon, VerbsData, etc.):
88+
8389
##Documentation contributions
8490
If you want to contribute to cmdlet documentation, please do not make a pull request to modify the actual files in the Documentation folder itself. Those files
8591
are automatically generated based upon comments in the actual classes. So if you want to modify documentation and or add an example of a cmdlet, navigate to the

0 commit comments

Comments
 (0)