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.
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+4-4
Original file line number
Diff line number
Diff line change
@@ -63,14 +63,14 @@ in a cmdlet that extens SPOWebCmdlet, the cmdlet will switch it's internal conte
63
63
varcontext=SelectedWeb.Context;
64
64
```
65
65
###Cmdlets will have to work both on-premises and in the cloud
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
-
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.
66
+
You can use preprocessor variables ("ONPREMISES" or "SP2013" and "SP2016") to build different cmdlets for the different targets. In cases where it is not possible to provide functionality for either the
67
+
cloud or on-premises, make sure to remove the full cmdlet from the compiled solution by having #IF(!SP2013) or #IF(SP2013) as the _first line of the cmdlet, before using statements.
68
68
69
69
See the following example
70
70
71
71
72
72
```csharp
73
-
#if!CLIENTSDKV15
73
+
#if!ONPREMISES
74
74
usingMicrosoft.SharePoint.Client;
75
75
76
76
publicclassMyCmdlet : SPOWebCmdlet
@@ -80,7 +80,7 @@ public class MyCmdlet : SPOWebCmdlet
80
80
#endif
81
81
```
82
82
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.
83
+
If only parts of a cmdlet require different behaviour based upon the different version of the SDK, you are recommended to use the #ONPREMISES or other available preprocessor variable throughout your code to exclude or include certain code.
[CmdletHelp(@"Office365 only: Uses the tenant API to retrieve site information.
16
-
",Category=CmdletHelpCategory.TenantAdmin)]
17
-
[CmdletExample(Code=@"
18
-
PS:> Get-SPOTenantSite",Remarks="Returns all site collections",SortOrder=1)]
19
-
[CmdletExample(Code=@"
20
-
PS:> Get-SPOTenantSite -Url http://tenant.sharepoint.com/sites/projects",Remarks="Returns information about the project site.",SortOrder=2)]
15
+
[CmdletHelp(@"Office365 only: Uses the tenant API to retrieve site information.",Category=CmdletHelpCategory.TenantAdmin)]
16
+
[CmdletExample(Code=@"PS:> Get-SPOTenantSite",Remarks="Returns all site collections",SortOrder=1)]
17
+
[CmdletExample(Code=@"PS:> Get-SPOTenantSite -Url http://tenant.sharepoint.com/sites/projects",Remarks="Returns information about the project site.",SortOrder=2)]
18
+
[CmdletExample(Code=@"PS:> Get-SPOTenantSite -Detailed",Remarks="Returns all sites with the full details of these sites",SortOrder=3)]
19
+
[CmdletExample(Code=@"PS:> Get-SPOTenantSite -IncludeOneDriveSites",Remarks="Returns all sites including all OneDrive 4 Business sites",SortOrder=4)]
21
20
publicclassGetTenantSite:SPOAdminCmdlet
22
21
{
23
22
[Parameter(Mandatory=false,HelpMessage="The URL of the site",Position=0,ValueFromPipeline=true)]
@@ -27,10 +26,10 @@ public class GetTenantSite : SPOAdminCmdlet
27
26
[Parameter(Mandatory=false,HelpMessage="By default, not all returned attributes are populated. This switch populates all attributes. It can take several seconds to run. Without this, some attributes will show default values that may not be correct.")]
28
27
publicSwitchParameterDetailed;
29
28
30
-
[Parameter(Mandatory=false)]
29
+
[Parameter(Mandatory=false,HelpMessage="By default, the OneDrives are not returned. This switch includes all OneDrives. This can take some extra time to run")]
31
30
publicSwitchParameterIncludeOneDriveSites;
32
31
33
-
[Parameter(Mandatory=false)]
32
+
[Parameter(Mandatory=false,HelpMessage="When the switch IncludeOneDriveSites is used, this switch ignores the question shown that the command can take a long time to execute")]
[CmdletExample(Code=@"PS:> Get-SPOWebTemplates -LCID 1033",Remarks=@"Returns all webtemplates for the Locale with ID 1033 (English)",SortOrder=2)]
13
+
[CmdletExample(Code=@"PS:> Get-SPOWebTemplates -CompatibilityLevel 15",Remarks=@"Returns all webtemplates for the compatibility level 15",SortOrder=2)]
[Parameter(Mandatory=true,HelpMessage=@"Specifies the title of the new site collection")]
29
29
publicstringTitle;
30
30
31
31
[Parameter(Mandatory=true,HelpMessage=@"Specifies the full URL of the new site collection. It must be in a valid managed path in the company's site. For example, for company contoso, valid managed paths are https://contoso.sharepoint.com/sites and https://contoso.sharepoint.com/teams.")]
32
32
publicstringUrl;
33
33
34
-
[Parameter(Mandatory=false)]
34
+
[Parameter(Mandatory=false,HelpMessage=@"Specifies the description of the new site collection")]
35
35
publicstringDescription=string.Empty;
36
36
37
37
[Parameter(Mandatory=true,HelpMessage=@"Specifies the user name of the site collection's primary owner. The owner must be a user instead of a security group or an email-enabled security group.")]
@@ -49,16 +49,16 @@ public class NewTenantSite : SPOAdminCmdlet
49
49
[Parameter(Mandatory=false,HelpMessage=@"Specifies the quota for this site collection in Sandboxed Solutions units. This value must not exceed the company's aggregate available Sandboxed Solutions quota. The default value is 0. For more information, see Resource Usage Limits on Sandboxed Solutions in SharePoint 2010 : http://msdn.microsoft.com/en-us/library/gg615462.aspx.")]
50
50
publicdoubleResourceQuota=0;
51
51
52
-
[Parameter(Mandatory=false)]
52
+
[Parameter(Mandatory=false,HelpMessage=@"Specifies the warning level for the resource quota. This value must not exceed the value set for the ResourceQuota parameter")]
53
53
publicdoubleResourceQuotaWarningLevel=0;
54
54
55
55
[Parameter(Mandatory=false,HelpMessage=@"Specifies the storage quota for this site collection in megabytes. This value must not exceed the company's available quota.")]
56
56
publiclongStorageQuota=100;
57
57
58
-
[Parameter(Mandatory=false)]
58
+
[Parameter(Mandatory=false,HelpMessage=@"Specifies the warning level for the storage quota in megabytes. This value must not exceed the values set for the StorageQuota parameter")]
59
59
publiclongStorageQuotaWarningLevel=100;
60
60
61
-
#if !CLIENTSDKV15
61
+
#if !ONPREMISES
62
62
[Parameter(Mandatory=false)]
63
63
publicSwitchParameterRemoveDeletedSite;
64
64
#endif
@@ -67,7 +67,7 @@ public class NewTenantSite : SPOAdminCmdlet
Remarks=@"This will remove the site collection with the url 'https://tenant.sharepoint.com/sites/contoso' and put it in the recycle bin.",SortOrder=1)]
Remarks=@"This will remove the site collection with the url 'https://tenant.sharepoint.com/sites/contoso' with force and it will skip the recycle bin.",SortOrder=1)]
19
+
Remarks=@"This will remove the site collection with the url 'https://tenant.sharepoint.com/sites/contoso' with force and it will skip the recycle bin.",SortOrder=2)]
0 commit comments