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

Commit 7ebefb3

Browse files
committed
Merge pull request #317 from OfficeDev/dev
May 2016 Release
2 parents 2c859e8 + ad10f08 commit 7ebefb3

File tree

272 files changed

+4412
-1439
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

272 files changed

+4412
-1439
lines changed
3.16 MB
Binary file not shown.
3.2 MB
Binary file not shown.
3.31 MB
Binary file not shown.

CONTRIBUTING.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,14 @@ in a cmdlet that extens SPOWebCmdlet, the cmdlet will switch it's internal conte
6363
var context = SelectedWeb.Context;
6464
```
6565
###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.
6868

6969
See the following example
7070

7171

7272
```csharp
73-
#if !CLIENTSDKV15
73+
#if !ONPREMISES
7474
using Microsoft.SharePoint.Client;
7575

7676
public class MyCmdlet : SPOWebCmdlet
@@ -80,7 +80,7 @@ public class MyCmdlet : SPOWebCmdlet
8080
#endif
8181
```
8282

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.
8484

8585
###Cmdlets will have to use common verbs
8686

CmdletHelpGenerator/CmdletInfo.cs

+2-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.Linq;
4-
using System.Text;
5-
using System.Threading.Tasks;
1+
using System.Collections.Generic;
62

7-
namespace OfficeDevPnP.PowerShell.CmdletHelpGenerator
3+
namespace SharePointPnP.PowerShell.CmdletHelpGenerator
84
{
95
public class CmdletInfo
106
{

CmdletHelpGenerator/CmdletParameterInfo.cs

+1-7
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.Linq;
4-
using System.Text;
5-
using System.Threading.Tasks;
6-
7-
namespace OfficeDevPnP.PowerShell.CmdletHelpGenerator
1+
namespace SharePointPnP.PowerShell.CmdletHelpGenerator
82
{
93
public class CmdletParameterInfo
104
{

CmdletHelpGenerator/CmdletSyntax.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using System.Collections.Generic;
22

3-
namespace OfficeDevPnP.PowerShell.CmdletHelpGenerator
3+
namespace SharePointPnP.PowerShell.CmdletHelpGenerator
44
{
55
public class CmdletSyntax
66
{

CmdletHelpGenerator/Program.cs

+2-4
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,13 @@
33
using System.Linq;
44
using System.Management.Automation;
55
using System.Reflection;
6-
using System.Security.Cryptography;
76
using System.Text;
87
using System.Xml.Linq;
9-
using OfficeDevPnP.PowerShell.CmdletHelpAttributes;
10-
using System.Text.RegularExpressions;
8+
using SharePointPnP.PowerShell.CmdletHelpAttributes;
119
using System.Runtime.Serialization;
1210
using System.IO;
1311

14-
namespace OfficeDevPnP.PowerShell.CmdletHelpGenerator
12+
namespace SharePointPnP.PowerShell.CmdletHelpGenerator
1513
{
1614
class Program
1715
{

CmdletHelpGenerator/OfficeDevPnP.PowerShell.CmdletHelpGenerator.csproj renamed to CmdletHelpGenerator/SharePointPnP.PowerShell.CmdletHelpGenerator.csproj

+24-4
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
<ProjectGuid>{B53C2D73-E46B-47E1-BB80-C2A363A53FB3}</ProjectGuid>
88
<OutputType>Exe</OutputType>
99
<AppDesignerFolder>Properties</AppDesignerFolder>
10-
<RootNamespace>OfficeDevPnP.PowerShell.CmdletHelpGenerator</RootNamespace>
11-
<AssemblyName>OfficeDevPnP.PowerShell.CmdletHelpGenerator</AssemblyName>
10+
<RootNamespace>SharePointPnP.PowerShell.CmdletHelpGenerator</RootNamespace>
11+
<AssemblyName>SharePointPnP.PowerShell.CmdletHelpGenerator</AssemblyName>
1212
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
1313
<FileAlignment>512</FileAlignment>
1414
<SccProjectName>
@@ -74,6 +74,26 @@
7474
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
7575
<Prefer32Bit>true</Prefer32Bit>
7676
</PropertyGroup>
77+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug16|AnyCPU'">
78+
<DebugSymbols>true</DebugSymbols>
79+
<OutputPath>bin\Debug16\</OutputPath>
80+
<DefineConstants>DEBUG;TRACE</DefineConstants>
81+
<DebugType>full</DebugType>
82+
<PlatformTarget>AnyCPU</PlatformTarget>
83+
<ErrorReport>prompt</ErrorReport>
84+
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
85+
<Prefer32Bit>true</Prefer32Bit>
86+
</PropertyGroup>
87+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release16|AnyCPU'">
88+
<OutputPath>bin\Release16\</OutputPath>
89+
<DefineConstants>TRACE</DefineConstants>
90+
<Optimize>true</Optimize>
91+
<DebugType>pdbonly</DebugType>
92+
<PlatformTarget>AnyCPU</PlatformTarget>
93+
<ErrorReport>prompt</ErrorReport>
94+
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
95+
<Prefer32Bit>true</Prefer32Bit>
96+
</PropertyGroup>
7797
<ItemGroup>
7898
<Reference Include="System" />
7999
<Reference Include="System.Core" />
@@ -101,9 +121,9 @@
101121
<None Include="App.config" />
102122
</ItemGroup>
103123
<ItemGroup>
104-
<ProjectReference Include="..\HelpAttributes\OfficeDevPnP.PowerShell.CmdletHelpAttributes.csproj">
124+
<ProjectReference Include="..\HelpAttributes\SharePointPnP.PowerShell.CmdletHelpAttributes.csproj">
105125
<Project>{fdd50bbd-ae78-4b10-9549-0566686719ab}</Project>
106-
<Name>OfficeDevPnP.PowerShell.CmdletHelpAttributes</Name>
126+
<Name>SharePointPnP.PowerShell.CmdletHelpAttributes</Name>
107127
</ProjectReference>
108128
</ItemGroup>
109129
<ItemGroup>

Commands/Admin/GetTenantSite.cs

+13-14
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,22 @@
1-
#if !CLIENTSDKV15
1+
#if !ONPREMISES
22
using System.ComponentModel;
33
using System.Linq;
44
using System.Management.Automation;
55
using Microsoft.SharePoint.Client;
6-
using OfficeDevPnP.PowerShell.CmdletHelpAttributes;
7-
using OfficeDevPnP.PowerShell.Commands.Base;
8-
using OfficeDevPnP.PowerShell.Commands.Enums;
9-
using Resources = OfficeDevPnP.PowerShell.Commands.Properties.Resources;
6+
using SharePointPnP.PowerShell.CmdletHelpAttributes;
7+
using SharePointPnP.PowerShell.Commands.Base;
8+
using SharePointPnP.PowerShell.Commands.Enums;
9+
using Resources = SharePointPnP.PowerShell.Commands.Properties.Resources;
1010

11-
namespace OfficeDevPnP.PowerShell.Commands
11+
namespace SharePointPnP.PowerShell.Commands
1212
{
1313

1414
[Cmdlet(VerbsCommon.Get, "SPOTenantSite", SupportsShouldProcess = true)]
15-
[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)]
2120
public class GetTenantSite : SPOAdminCmdlet
2221
{
2322
[Parameter(Mandatory = false, HelpMessage = "The URL of the site", Position = 0, ValueFromPipeline = true)]
@@ -27,10 +26,10 @@ public class GetTenantSite : SPOAdminCmdlet
2726
[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.")]
2827
public SwitchParameter Detailed;
2928

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")]
3130
public SwitchParameter IncludeOneDriveSites;
3231

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")]
3433
public SwitchParameter Force;
3534

3635
protected override void ExecuteCmdlet()

Commands/Admin/GetTimeZoneId.cs

+6-12
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,18 @@
1-
using OfficeDevPnP.PowerShell.CmdletHelpAttributes;
1+
using SharePointPnP.PowerShell.CmdletHelpAttributes;
22
using System;
33
using System.Collections.Generic;
44
using System.Linq;
55
using System.Management.Automation;
66

7-
namespace OfficeDevPnP.PowerShell.Commands
7+
namespace SharePointPnP.PowerShell.Commands
88
{
99
[Cmdlet(VerbsCommon.Get, "SPOTimeZoneId")]
1010
[CmdletHelp("Returns a time zone ID", Category = CmdletHelpCategory.TenantAdmin)]
11-
[CmdletExample(
12-
Code = @"PS:> Get-SPOTimeZoneId",
13-
Remarks = @"This will return all time zone IDs in use by Office 365.
14-
", SortOrder = 1)]
15-
[CmdletExample(
16-
Code = @"PS:> Get-SPOTimeZoneId -Match Stockholm",
17-
Remarks = @"This will return the time zone IDs for Stockholm
18-
", SortOrder = 2)]
11+
[CmdletExample(Code = @"PS:> Get-SPOTimeZoneId",Remarks = @"This will return all time zone IDs in use by Office 365.", SortOrder = 1)]
12+
[CmdletExample(Code = @"PS:> Get-SPOTimeZoneId -Match Stockholm", Remarks = @"This will return the time zone IDs for Stockholm", SortOrder = 2)]
1913
public class GetTimeZoneId : PSCmdlet
2014
{
21-
[Parameter(Mandatory = false, Position=0)]
15+
[Parameter(Mandatory = false, Position=0, HelpMessage = "A string to search for like 'Stockholm'")]
2216
public string Match;
2317

2418
protected override void ProcessRecord()
@@ -46,7 +40,7 @@ private IEnumerable<Zone> FindZone(string match)
4640

4741
public IEnumerable<Zone> AllZones()
4842
{
49-
foreach (var zone in Enum.GetValues(typeof(Core.Enums.TimeZone)))
43+
foreach (var zone in Enum.GetValues(typeof(OfficeDevPnP.Core.Enums.TimeZone)))
5044
{
5145
var description = zone.ToString();
5246
var identifier = description.Split('_')[0];

Commands/Admin/GetWebTemplates.cs

+10-12
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,23 @@
1-
#if !CLIENTSDKV15
2-
using OfficeDevPnP.PowerShell.CmdletHelpAttributes;
1+
#if !ONPREMISES
2+
using SharePointPnP.PowerShell.CmdletHelpAttributes;
33
using Microsoft.SharePoint.Client;
4-
using OfficeDevPnP.PowerShell.Commands.Base;
4+
using SharePointPnP.PowerShell.Commands.Base;
55
using System.Management.Automation;
66

7-
namespace OfficeDevPnP.PowerShell.Commands
7+
namespace SharePointPnP.PowerShell.Commands
88
{
99
[Cmdlet(VerbsCommon.Get, "SPOWebTemplates")]
1010
[CmdletHelp(@"Office365 only: Returns the available web templates.", Category = CmdletHelpCategory.TenantAdmin)]
11-
[CmdletExample(
12-
Code = @"PS:> Get-SPOWebTemplates", SortOrder = 1)]
13-
[CmdletExample(
14-
Code = @"PS:> Get-SPOWebTemplates -LCID 1033",
15-
Remarks = @"Returns all webtemplates for the Locale with ID 1033 (English)", SortOrder = 2)]
16-
11+
[CmdletExample(Code = @"PS:> Get-SPOWebTemplates", SortOrder = 1)]
12+
[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)]
14+
[CmdletRelatedLink(Text = "Locale IDs", Url = "http://go.microsoft.com/fwlink/p/?LinkId=242911Id=242911")]
1715
public class GetWebTemplates : SPOAdminCmdlet
1816
{
19-
[Parameter(Mandatory = false)]
17+
[Parameter(Mandatory = false, HelpMessage = "The language id like 1033 for English")]
2018
public uint Lcid;
2119

22-
[Parameter(Mandatory = false)]
20+
[Parameter(Mandatory = false, HelpMessage = "The version of SharePoint")]
2321
public int CompatibilityLevel;
2422

2523
protected override void ProcessRecord()

Commands/Admin/NewTenantSite.cs

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
using System.Management.Automation;
22
using Microsoft.SharePoint.Client;
3+
using SharePointPnP.PowerShell.CmdletHelpAttributes;
4+
using SharePointPnP.PowerShell.Commands.Base;
35
using OfficeDevPnP.Core.Entities;
4-
using OfficeDevPnP.PowerShell.CmdletHelpAttributes;
5-
using OfficeDevPnP.PowerShell.Commands.Base;
66

7-
namespace OfficeDevPnP.PowerShell.Commands
7+
namespace SharePointPnP.PowerShell.Commands
88
{
99
[Cmdlet(VerbsCommon.New, "SPOTenantSite")]
1010
[CmdletHelp("Creates a new site collection for the current tenant",
@@ -25,13 +25,13 @@ namespace OfficeDevPnP.PowerShell.Commands
2525
Url = "http://blogs.msdn.com/b/vesku/archive/2014/06/09/provisioning-site-collections-using-sp-app-model-in-on-premises-with-just-csom.aspx")]
2626
public class NewTenantSite : SPOAdminCmdlet
2727
{
28-
[Parameter(Mandatory = true)]
28+
[Parameter(Mandatory = true, HelpMessage = @"Specifies the title of the new site collection")]
2929
public string Title;
3030

3131
[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.")]
3232
public string Url;
3333

34-
[Parameter(Mandatory = false)]
34+
[Parameter(Mandatory = false, HelpMessage = @"Specifies the description of the new site collection")]
3535
public string Description = string.Empty;
3636

3737
[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
4949
[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.")]
5050
public double ResourceQuota = 0;
5151

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")]
5353
public double ResourceQuotaWarningLevel = 0;
5454

5555
[Parameter(Mandatory = false, HelpMessage = @"Specifies the storage quota for this site collection in megabytes. This value must not exceed the company's available quota.")]
5656
public long StorageQuota = 100;
5757

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")]
5959
public long StorageQuotaWarningLevel = 100;
6060

61-
#if !CLIENTSDKV15
61+
#if !ONPREMISES
6262
[Parameter(Mandatory = false)]
6363
public SwitchParameter RemoveDeletedSite;
6464
#endif
@@ -67,7 +67,7 @@ public class NewTenantSite : SPOAdminCmdlet
6767

6868
protected override void ExecuteCmdlet()
6969
{
70-
#if CLIENTSDKV15
70+
#if ONPREMISES
7171
var entity = new SiteEntity();
7272
entity.Url = Url;
7373
entity.Title = Title;

Commands/Admin/RemoveTenantSite.cs

+13-8
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,28 @@
1-
#if !CLIENTSDKV15
1+
#if !ONPREMISES
22
using System.Management.Automation;
33
using Microsoft.SharePoint.Client;
4-
using OfficeDevPnP.PowerShell.CmdletHelpAttributes;
5-
using OfficeDevPnP.PowerShell.Commands.Base;
6-
using Resources = OfficeDevPnP.PowerShell.Commands.Properties.Resources;
4+
using SharePointPnP.PowerShell.CmdletHelpAttributes;
5+
using SharePointPnP.PowerShell.Commands.Base;
6+
using Resources = SharePointPnP.PowerShell.Commands.Properties.Resources;
77
using System;
88

9-
namespace OfficeDevPnP.PowerShell.Commands
9+
namespace SharePointPnP.PowerShell.Commands
1010
{
1111
[Cmdlet(VerbsCommon.Remove, "SPOTenantSite", ConfirmImpact = ConfirmImpact.High, SupportsShouldProcess = true)]
1212
[CmdletHelp("Office365 only: Removes a site collection from the current tenant",
13-
DetailedDescription = "",
1413
Category = CmdletHelpCategory.TenantAdmin)]
14+
[CmdletExample(
15+
Code = @"PS:> Remove-SPOTenantSite -Url https://tenant.sharepoint.com/sites/contoso",
16+
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)]
1517
[CmdletExample(
1618
Code = @"PS:> Remove-SPOTenantSite -Url https://tenant.sharepoint.com/sites/contoso -Force -SkipRecycleBin",
17-
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)]
20+
[CmdletExample(
21+
Code = @"PS:> Remove-SPOTenantSite -Url https://tenant.sharepoint.com/sites/contoso -FromRecycleBin",
22+
Remarks = @"This will remove the site collection with the url 'https://tenant.sharepoint.com/sites/contoso' from the recycle bin.", SortOrder = 3)]
1823
public class RemoveSite : SPOAdminCmdlet
1924
{
20-
[Parameter(Mandatory = true, Position = 0, ValueFromPipeline = true)]
25+
[Parameter(Mandatory = true, Position = 0, ValueFromPipeline = true, HelpMessage = "Specifies the full URL of the site collection that needs to be deleted")]
2126
public string Url;
2227

2328
[Parameter(Mandatory = false, HelpMessage = "Do not add to the trashcan if selected.")]

0 commit comments

Comments
 (0)