You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 19, 2021. It is now read-only.
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.
43
43
44
44
A few notes:
45
-
###Every new cmdlet should provide help and examples###
45
+
###Every new cmdlet should provide help and examples
46
46
As documentation is autogenerated by building the solution, make sure that you include both help and examples, alike
47
47
48
48
```csharp
@@ -55,17 +55,19 @@ As documentation is autogenerated by building the solution, make sure that you i
55
55
{
56
56
}
57
57
```
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
59
59
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
60
60
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
61
61
62
62
```csharp
63
63
varcontext=SelectedWeb.Context;
64
64
```
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
66
66
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
67
67
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
+
69
71
70
72
```csharp
71
73
#if!CLIENTSDKV15
@@ -80,6 +82,10 @@ public class MyCmdlet : SPOWebCmdlet
80
82
81
83
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.
82
84
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
+
83
89
##Documentation contributions
84
90
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
85
91
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