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

Commit 0220ca6

Browse files
committed
Merge pull request #314 from erwinvanhunen/dev
May 2016 Release
2 parents 116fc77 + 9435829 commit 0220ca6

File tree

241 files changed

+2225
-1276
lines changed

Some content is hidden

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

241 files changed

+2225
-1276
lines changed

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

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
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)]

Commands/Admin/GetTimeZoneId.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
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)]
@@ -40,7 +40,7 @@ private IEnumerable<Zone> FindZone(string match)
4040

4141
public IEnumerable<Zone> AllZones()
4242
{
43-
foreach (var zone in Enum.GetValues(typeof(Core.Enums.TimeZone)))
43+
foreach (var zone in Enum.GetValues(typeof(OfficeDevPnP.Core.Enums.TimeZone)))
4444
{
4545
var description = zone.ToString();
4646
var identifier = description.Split('_')[0];

Commands/Admin/GetWebTemplates.cs

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
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)]

Commands/Admin/NewTenantSite.cs

+5-5
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",
@@ -58,7 +58,7 @@ public class NewTenantSite : SPOAdminCmdlet
5858
[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

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
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",

Commands/Admin/SetTenantSite.cs

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
#if !CLIENTSDKV15
1+
#if !ONPREMISES
22
using System.Management.Automation;
33
using Microsoft.Online.SharePoint.TenantManagement;
44
using Microsoft.SharePoint.Client;
5-
using OfficeDevPnP.PowerShell.CmdletHelpAttributes;
6-
using OfficeDevPnP.PowerShell.Commands.Base;
5+
using SharePointPnP.PowerShell.CmdletHelpAttributes;
6+
using SharePointPnP.PowerShell.Commands.Base;
77

8-
namespace OfficeDevPnP.PowerShell.Commands
8+
namespace SharePointPnP.PowerShell.Commands
99
{
1010
[Cmdlet(VerbsCommon.Set, "SPOTenantSite")]
1111
[CmdletHelp(@"Office365 only: Uses the tenant API to set site information.",

Commands/Apps/GetAppInstance.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
using System.Management.Automation;
22
using Microsoft.SharePoint.Client;
3-
using OfficeDevPnP.PowerShell.CmdletHelpAttributes;
4-
using OfficeDevPnP.PowerShell.Commands.Base.PipeBinds;
3+
using SharePointPnP.PowerShell.CmdletHelpAttributes;
4+
using SharePointPnP.PowerShell.Commands.Base.PipeBinds;
55

6-
namespace OfficeDevPnP.PowerShell.Commands
6+
namespace SharePointPnP.PowerShell.Commands
77
{
88
[Cmdlet(VerbsCommon.Get, "SPOAppInstance")]
99
[CmdletHelp("Returns a SharePoint AddIn Instance in the site", Category = CmdletHelpCategory.Apps)]

Commands/Apps/ImportAppPackage.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
using System.IO;
22
using System.Management.Automation;
33
using System.Globalization;
4-
using OfficeDevPnP.PowerShell.CmdletHelpAttributes;
4+
using SharePointPnP.PowerShell.CmdletHelpAttributes;
55
using Microsoft.SharePoint.Client;
66
using OfficeDevPnP.Core;
77

8-
namespace OfficeDevPnP.PowerShell.Commands
8+
namespace SharePointPnP.PowerShell.Commands
99
{
1010
[Cmdlet(VerbsData.Import, "SPOAppPackage")]
1111

Commands/Apps/UninstallAppInstance.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
using Microsoft.SharePoint.Client;
22
using System.Management.Automation;
3-
using OfficeDevPnP.PowerShell.Commands.Base.PipeBinds;
4-
using OfficeDevPnP.PowerShell.CmdletHelpAttributes;
3+
using SharePointPnP.PowerShell.Commands.Base.PipeBinds;
4+
using SharePointPnP.PowerShell.CmdletHelpAttributes;
55

6-
namespace OfficeDevPnP.PowerShell.Commands
6+
namespace SharePointPnP.PowerShell.Commands
77
{
88
[Cmdlet(VerbsLifecycle.Uninstall, "SPOAppInstance", SupportsShouldProcess = true)]
99
[CmdletHelp("Removes an app from a site", Category = CmdletHelpCategory.Apps)]

Commands/Base/ConnectSPOnline.cs

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
using OfficeDevPnP.Core.Utilities;
2-
using OfficeDevPnP.PowerShell.CmdletHelpAttributes;
3-
using OfficeDevPnP.PowerShell.Commands.Base.PipeBinds;
2+
using SharePointPnP.PowerShell.CmdletHelpAttributes;
3+
using SharePointPnP.PowerShell.Commands.Base.PipeBinds;
44
using System;
55
using System.IO;
66
using System.Management.Automation;
77
using System.Net;
88
using System.Security;
9-
#if !CLIENTSDKV15
9+
#if !ONPREMISES
1010
using Microsoft.SharePoint.Client.CompliancePolicy;
1111
#endif
1212

13-
namespace OfficeDevPnP.PowerShell.Commands.Base
13+
namespace SharePointPnP.PowerShell.Commands.Base
1414
{
1515
[Cmdlet("Connect", "SPOnline", SupportsShouldProcess = false)]
1616
[CmdletHelp("Connects to a SharePoint site and creates an in-memory context",
@@ -74,7 +74,7 @@ public class ConnectSPOnline : PSCmdlet
7474
[Parameter(Mandatory = true, ParameterSetName = "Weblogin", HelpMessage = "If you want to connect to SharePoint with browser based login")]
7575
public SwitchParameter UseWebLogin;
7676

77-
#if !CLIENTSDKV15
77+
#if !ONPREMISES
7878
[Parameter(Mandatory = true, ParameterSetName = "NativeAAD", HelpMessage = "The Client ID of the Azure AD Application")]
7979
[Parameter(Mandatory = true, ParameterSetName = "AppOnlyAAD", HelpMessage = "The Client ID of the Azure AD Application")]
8080
public string ClientId;
@@ -122,13 +122,13 @@ protected override void ProcessRecord()
122122
}
123123
SPOnlineConnection.CurrentConnection = SPOnlineConnectionHelper.InstantiateAdfsConnection(new Uri(Url), creds, Host, MinimalHealthScore, RetryCount, RetryWait, RequestTimeout, SkipTenantAdminCheck);
124124
}
125-
#if !CLIENTSDKV15
125+
#if !ONPREMISES
126126
else if (ParameterSetName == "NativeAAD")
127127
{
128128
if (ClearTokenCache)
129129
{
130130
string appDataFolder = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
131-
string configFile = Path.Combine(appDataFolder, "OfficeDevPnP.PowerShell\\tokencache.dat");
131+
string configFile = Path.Combine(appDataFolder, "SharePointPnP.PowerShell\\tokencache.dat");
132132
if (File.Exists(configFile))
133133
{
134134
File.Delete(configFile);

Commands/Base/Constants.cs

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

3-
namespace OfficeDevPnP.PowerShell.Commands.Base
3+
namespace SharePointPnP.PowerShell.Commands.Base
44
{
55
[Obsolete("Use OfficeDev/PnP.Core")]
66
public static class Constants

Commands/Base/DisconnectSPOnline.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
using OfficeDevPnP.PowerShell.CmdletHelpAttributes;
1+
using SharePointPnP.PowerShell.CmdletHelpAttributes;
22
using System;
33
using System.Management.Automation;
44

5-
namespace OfficeDevPnP.PowerShell.Commands.Base
5+
namespace SharePointPnP.PowerShell.Commands.Base
66
{
77
[Cmdlet("Disconnect", "SPOnline")]
88

Commands/Base/ExecuteQuery.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
using System.Management.Automation;
22
using Microsoft.SharePoint.Client;
3-
using OfficeDevPnP.PowerShell.CmdletHelpAttributes;
3+
using SharePointPnP.PowerShell.CmdletHelpAttributes;
44

5-
namespace OfficeDevPnP.PowerShell.Commands.Base
5+
namespace SharePointPnP.PowerShell.Commands.Base
66
{
77
[Cmdlet("Execute", "SPOQuery")]
88
[CmdletHelp("Executes any queued actions / changes on the SharePoint Client Side Object Model Context",

Commands/Base/GetAuthenticationRealm.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
using System;
22
using System.Management.Automation;
3-
using OfficeDevPnP.PowerShell.CmdletHelpAttributes;
3+
using SharePointPnP.PowerShell.CmdletHelpAttributes;
44
using System.Net;
55

6-
namespace OfficeDevPnP.PowerShell.Commands
6+
namespace SharePointPnP.PowerShell.Commands
77
{
88
[Cmdlet(VerbsCommon.Get, "SPOAuthenticationRealm")]
99
[CmdletHelp("Gets the authentication realm for the current web",

Commands/Base/GetAzureADManifestKeyCredentials.cs

+2-7
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
11
using System;
2-
using System.Collections.Generic;
3-
using System.Linq;
42
using System.Management.Automation;
53
using System.Security.Cryptography.X509Certificates;
6-
using System.Text;
7-
using System.Threading.Tasks;
8-
using OfficeDevPnP.Core.Framework.Provisioning.Providers.Json;
9-
using OfficeDevPnP.PowerShell.CmdletHelpAttributes;
4+
using SharePointPnP.PowerShell.CmdletHelpAttributes;
105

11-
namespace OfficeDevPnP.PowerShell.Commands.Base
6+
namespace SharePointPnP.PowerShell.Commands.Base
127
{
138
[Cmdlet(VerbsCommon.Get, "SPOAzureADManifestKeyCredentials")]
149
[CmdletHelp("Creates the JSON snippet that is required for the manifest json file for Azure WebApplication / WebAPI apps",

0 commit comments

Comments
 (0)