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

Commit 59f19f2

Browse files
Merge pull request #1149 from SharePoint/dev
October 2017 Intermediate Release 1
2 parents b05c3b1 + 374e778 commit 59f19f2

File tree

333 files changed

+18934
-3742
lines changed

Some content is hidden

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

333 files changed

+18934
-3742
lines changed

Commands/Admin/GetTenantSite.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
namespace SharePointPnP.PowerShell.Commands
1212
{
1313
[Cmdlet(VerbsCommon.Get, "PnPTenantSite", SupportsShouldProcess = true)]
14-
[CmdletHelp(@"Uses the tenant API to retrieve site information.",
14+
[CmdletHelp(@"Retrieve site information.", "Use this cmdlet to retrieve site information from your tenant administration.",
1515
Category = CmdletHelpCategory.TenantAdmin,
1616
SupportedPlatform = CmdletSupportedPlatform.Online,
1717
OutputType = typeof(Microsoft.Online.SharePoint.TenantAdministration.SiteProperties),

Commands/Admin/GetTimeZoneId.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ namespace SharePointPnP.PowerShell.Commands
88
{
99
[Cmdlet(VerbsCommon.Get, "PnPTimeZoneId")]
1010
[CmdletHelp("Returns a time zone ID",
11+
"In order to create a new classic site you need to specify the timezone this site will use. Use the cmdlet to retrieve a list of possible values.",
1112
Category = CmdletHelpCategory.TenantAdmin,
1213
OutputType = typeof(IEnumerable<Zone>),
1314
OutputTypeDescription =

Commands/Admin/GetWebTemplates.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ namespace SharePointPnP.PowerShell.Commands
88
{
99
[Cmdlet(VerbsCommon.Get, "PnPWebTemplates")]
1010
[CmdletHelp(@"Returns the available web templates.",
11+
"Will list all available templates one can use to create a classic site.",
1112
Category = CmdletHelpCategory.TenantAdmin,
1213
SupportedPlatform = CmdletSupportedPlatform.Online,
1314
OutputType =typeof(Microsoft.Online.SharePoint.TenantAdministration.SPOTenantWebTemplateCollection),

Commands/Admin/NewSite.cs

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ namespace SharePointPnP.PowerShell.Commands
1515
{
1616
[Cmdlet(VerbsCommon.New, "PnPSite")]
1717
[CmdletHelp("BETA: This cmdlet is using early release APIs. Notice that functionality and parameters can change. Creates a new site collection",
18+
"The New-PnPSite cmdlet creates a new site collection for the current tenant. Currently only 'modern' sites like Communication Site and the Modern Team Site are supported. If you want to create a classic site, use New-PnPTenantSite.",
1819
OutputType = typeof(string),
1920
OutputTypeDescription = "Returns the url of the newly created site collection",
20-
DetailedDescription = @"The New-PnPSite cmdlet creates a new site collection for the current tenant. Currently only 'modern' sites like Communication Site and the Modern Team Site are supported. If you want to create a classic site, use New-PnPTenantSite.",
2121
Category = CmdletHelpCategory.TenantAdmin, SupportedPlatform = CmdletSupportedPlatform.Online)]
2222
[CmdletExample(
2323
Code = @"PS:> New-PnPSite -Type CommunicationSite -Title Contoso -Url https://tenant.sharepoint.com/sites/contoso",
@@ -47,25 +47,25 @@ namespace SharePointPnP.PowerShell.Commands
4747
Code = @"PS:> New-PnPSite -Type TeamSite -Title Contoso -Alias contoso -IsPublic",
4848
Remarks = @"This will create a new Modern Team Site collection with the title 'Contoso' and the url 'https://tenant.sharepoint.com/sites/contoso' and sets the site to public.",
4949
SortOrder = 7)]
50-
[CmdletAdditionalParameter(ParameterType = typeof(string), ParameterName = "Title", Mandatory = true, HelpMessage = @"Specifies the title of the new site collection", ParameterSetName = "CommunicationBuiltInDesign")]
50+
[CmdletAdditionalParameter(ParameterType = typeof(string), ParameterName = "Title", Mandatory = true, HelpMessage = @"Specifies the title of the new site collection", ParameterSetName = "Communication Site With Built-in Design")]
5151
[CmdletAdditionalParameter(ParameterType = typeof(string), ParameterName = "Title", Mandatory = true, HelpMessage = @"Specifies the title of the new site collection", ParameterSetName = "CommunicationCustomInDesign")]
52-
[CmdletAdditionalParameter(ParameterType = typeof(string), ParameterName = "Url", Mandatory = true, HelpMessage = @"Specifies the full url of the new site collection", ParameterSetName = "CommunicationBuiltInDesign")]
52+
[CmdletAdditionalParameter(ParameterType = typeof(string), ParameterName = "Url", Mandatory = true, HelpMessage = @"Specifies the full url of the new site collection", ParameterSetName = "Communication Site With Built-in Design")]
5353
[CmdletAdditionalParameter(ParameterType = typeof(string), ParameterName = "Url", Mandatory = true, HelpMessage = @"Specifies the full url of the new site collection", ParameterSetName = "CommunicationCustomInDesign")]
54-
[CmdletAdditionalParameter(ParameterType = typeof(string), ParameterName = "Description", Mandatory = false, HelpMessage = @"Specifies the description of the new site collection", ParameterSetName = "CommunicationBuiltInDesign")]
54+
[CmdletAdditionalParameter(ParameterType = typeof(string), ParameterName = "Description", Mandatory = false, HelpMessage = @"Specifies the description of the new site collection", ParameterSetName = "Communication Site With Built-in Design")]
5555
[CmdletAdditionalParameter(ParameterType = typeof(string), ParameterName = "Description", Mandatory = false, HelpMessage = @"Specifies the description of the new site collection", ParameterSetName = "CommunicationCustomInDesign")]
56-
[CmdletAdditionalParameter(ParameterType = typeof(string), ParameterName = "Classification", Mandatory = false, HelpMessage = @"Specifies the classification of the new site collection", ParameterSetName = "CommunicationBuiltInDesign")]
56+
[CmdletAdditionalParameter(ParameterType = typeof(string), ParameterName = "Classification", Mandatory = false, HelpMessage = @"Specifies the classification of the new site collection", ParameterSetName = "Communication Site With Built-in Design")]
5757
[CmdletAdditionalParameter(ParameterType = typeof(string), ParameterName = "Classification", Mandatory = false, HelpMessage = @"Specifies the classification of the new site collection", ParameterSetName = "CommunicationCustomInDesign")]
58-
[CmdletAdditionalParameter(ParameterType = typeof(SwitchParameter), ParameterName = "AllowFileSharingForGuestUsers", Mandatory = false, HelpMessage = @"Specifies if guest users can share files in the new site collection", ParameterSetName = "CommunicationBuiltInDesign")]
58+
[CmdletAdditionalParameter(ParameterType = typeof(SwitchParameter), ParameterName = "AllowFileSharingForGuestUsers", Mandatory = false, HelpMessage = @"Specifies if guest users can share files in the new site collection", ParameterSetName = "Communication Site With Built-in Design")]
5959
[CmdletAdditionalParameter(ParameterType = typeof(SwitchParameter), ParameterName = "AllowFileSharingForGuestUsers", Mandatory = false, HelpMessage = @"Specifies if guest users can share files in the new site collection", ParameterSetName = "CommunicationCustomInDesign")]
60-
[CmdletAdditionalParameter(ParameterType = typeof(OfficeDevPnP.Core.Sites.CommunicationSiteDesign), ParameterName = "SiteDesign", Mandatory = false, HelpMessage = @"Specifies the site design of the new site collection. Defaults to 'Topic'", ParameterSetName = "CommunicationBuiltInDesign")]
60+
[CmdletAdditionalParameter(ParameterType = typeof(OfficeDevPnP.Core.Sites.CommunicationSiteDesign), ParameterName = "SiteDesign", Mandatory = false, HelpMessage = @"Specifies the site design of the new site collection. Defaults to 'Topic'", ParameterSetName = "Communication Site With Built-in Design")]
6161
[CmdletAdditionalParameter(ParameterType = typeof(GuidPipeBind), ParameterName = "SiteDesignId", Mandatory = true, HelpMessage = @"Specifies the site design id to use for the new site collection. If specified will override SiteDesign", ParameterSetName = "CommunicationCustomInDesign")]
62-
[CmdletAdditionalParameter(ParameterType = typeof(uint), ParameterName = "Lcid", Mandatory = false, HelpMessage = @"Specifies the language of the new site collection. Defaults to the current language of the web connected to.", ParameterSetName = "CommunicationBuiltInDesign")]
62+
[CmdletAdditionalParameter(ParameterType = typeof(uint), ParameterName = "Lcid", Mandatory = false, HelpMessage = @"Specifies the language of the new site collection. Defaults to the current language of the web connected to.", ParameterSetName = "Communication Site With Built-in Design")]
6363
[CmdletAdditionalParameter(ParameterType = typeof(uint), ParameterName = "Lcid", Mandatory = false, HelpMessage = @"Specifies the language of the new site collection. Defaults to the current language of the web connected to.", ParameterSetName = "CommunicationCustomInDesign")]
64-
[CmdletAdditionalParameter(ParameterType = typeof(string), ParameterName = "Title", Mandatory = true, HelpMessage = @"Specifies the title of the new site collection", ParameterSetName = "TeamSite")]
65-
[CmdletAdditionalParameter(ParameterType = typeof(string), ParameterName = "Alias", Mandatory = true, HelpMessage = @"Specifies the alias of the new site collection", ParameterSetName = "TeamSite")]
66-
[CmdletAdditionalParameter(ParameterType = typeof(string), ParameterName = "Description", Mandatory = false, HelpMessage = @"Specifies the description of the new site collection", ParameterSetName = "TeamSite")]
67-
[CmdletAdditionalParameter(ParameterType = typeof(string), ParameterName = "Classification", Mandatory = false, HelpMessage = @"Specifies the classification of the new site collection", ParameterSetName = "TeamSite")]
68-
[CmdletAdditionalParameter(ParameterType = typeof(string), ParameterName = "IsPublic", Mandatory = false, HelpMessage = @"Specifies if new site collection is public. Defaults to false.", ParameterSetName = "TeamSite")]
64+
[CmdletAdditionalParameter(ParameterType = typeof(string), ParameterName = "Title", Mandatory = true, HelpMessage = @"Specifies the title of the new site collection", ParameterSetName = "Team Site")]
65+
[CmdletAdditionalParameter(ParameterType = typeof(string), ParameterName = "Alias", Mandatory = true, HelpMessage = @"Specifies the alias of the new site collection", ParameterSetName = "Team Site")]
66+
[CmdletAdditionalParameter(ParameterType = typeof(string), ParameterName = "Description", Mandatory = false, HelpMessage = @"Specifies the description of the new site collection", ParameterSetName = "Team Site")]
67+
[CmdletAdditionalParameter(ParameterType = typeof(string), ParameterName = "Classification", Mandatory = false, HelpMessage = @"Specifies the classification of the new site collection", ParameterSetName = "Team Site")]
68+
[CmdletAdditionalParameter(ParameterType = typeof(string), ParameterName = "IsPublic", Mandatory = false, HelpMessage = @"Specifies if new site collection is public. Defaults to false.", ParameterSetName = "Team Site")]
6969
public class NewSite : PnPCmdlet, IDynamicParameters
7070
{
7171
[Parameter(Mandatory = true, HelpMessage = "@Specifies with type of site to create.")]
@@ -138,27 +138,27 @@ protected override void ExecuteCmdlet()
138138

139139
public class CommunicationSiteParameters
140140
{
141-
[Parameter(Mandatory = true, ParameterSetName = "CommunicationBuiltInDesign")]
141+
[Parameter(Mandatory = true, ParameterSetName = "Communication Site With Built-in Design")]
142142
[Parameter(Mandatory = true, ParameterSetName = "CommunicationCustomInDesign")]
143143
public string Title;
144144

145-
[Parameter(Mandatory = true, ParameterSetName = "CommunicationBuiltInDesign")]
145+
[Parameter(Mandatory = true, ParameterSetName = "Communication Site With Built-in Design")]
146146
[Parameter(Mandatory = true, ParameterSetName = "CommunicationCustomInDesign")]
147147
public string Url;
148148

149-
[Parameter(Mandatory = false, ParameterSetName = "CommunicationBuiltInDesign")]
149+
[Parameter(Mandatory = false, ParameterSetName = "Communication Site With Built-in Design")]
150150
[Parameter(Mandatory = false, ParameterSetName = "CommunicationCustomInDesign")]
151151
public string Description;
152152

153-
[Parameter(Mandatory = false, ParameterSetName = "CommunicationBuiltInDesign")]
153+
[Parameter(Mandatory = false, ParameterSetName = "Communication Site With Built-in Design")]
154154
[Parameter(Mandatory = false, ParameterSetName = "CommunicationCustomInDesign")]
155155
public string Classification;
156156

157-
[Parameter(Mandatory = false, ParameterSetName = "CommunicationBuiltInDesign")]
157+
[Parameter(Mandatory = false, ParameterSetName = "Communication Site With Built-in Design")]
158158
[Parameter(Mandatory = false, ParameterSetName = "CommunicationCustomInDesign")]
159159
public SwitchParameter AllowFileSharingForGuestUsers;
160160

161-
[Parameter(Mandatory = false, ParameterSetName = "CommunicationBuiltInDesign")]
161+
[Parameter(Mandatory = false, ParameterSetName = "Communication Site With Built-in Design")]
162162
public OfficeDevPnP.Core.Sites.CommunicationSiteDesign SiteDesign = OfficeDevPnP.Core.Sites.CommunicationSiteDesign.Topic;
163163

164164
[Parameter(Mandatory = true, ParameterSetName = "CommunicationCustomInDesign")]
@@ -171,19 +171,19 @@ public class CommunicationSiteParameters
171171

172172
public class TeamSiteParameters
173173
{
174-
[Parameter(Mandatory = true, ParameterSetName = "TeamSite")]
174+
[Parameter(Mandatory = true, ParameterSetName = "Team Site")]
175175
public string Title;
176176

177-
[Parameter(Mandatory = true, ParameterSetName = "TeamSite")]
177+
[Parameter(Mandatory = true, ParameterSetName = "Team Site")]
178178
public string Alias;
179179

180-
[Parameter(Mandatory = false, ParameterSetName = "TeamSite")]
180+
[Parameter(Mandatory = false, ParameterSetName = "Team Site")]
181181
public string Description;
182182

183-
[Parameter(Mandatory = false, ParameterSetName = "TeamSite")]
183+
[Parameter(Mandatory = false, ParameterSetName = "Team Site")]
184184
public string Classification;
185185

186-
[Parameter(Mandatory = false, ParameterSetName = "TeamSite")]
186+
[Parameter(Mandatory = false, ParameterSetName = "Team Site")]
187187
public SwitchParameter IsPublic;
188188
}
189189
}

Commands/Admin/NewTenantSite.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ namespace SharePointPnP.PowerShell.Commands
1212
{
1313
[Cmdlet(VerbsCommon.New, "PnPTenantSite")]
1414
[CmdletHelp("Creates a new site collection for the current tenant",
15-
DetailedDescription = @"The New-PnPTenantSite cmdlet creates a new site collection for the current company. However, creating a new SharePoint
15+
@"The New-PnPTenantSite cmdlet creates a new site collection for the current company. However, creating a new SharePoint
1616
Online site collection fails if a deleted site with the same URL exists in the Recycle Bin. If you want to use this command for an on-premises farm, please refer to http://blogs.msdn.com/b/vesku/archive/2014/06/09/provisioning-site-collections-using-sp-app-model-in-on-premises-with-just-csom.aspx ",
1717
Category = CmdletHelpCategory.TenantAdmin)]
1818
[CmdletExample(

Commands/Admin/RemoveTenantSite.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
namespace SharePointPnP.PowerShell.Commands
1111
{
1212
[Cmdlet(VerbsCommon.Remove, "PnPTenantSite", ConfirmImpact = ConfirmImpact.High, SupportsShouldProcess = true)]
13-
[CmdletHelp("Removes a site collection from the current tenant",
13+
[CmdletHelp("Removes a site collection",
14+
"Removes a site collection which is listed in your tenant administration site.",
1415
SupportedPlatform = CmdletSupportedPlatform.Online,
1516
Category = CmdletHelpCategory.TenantAdmin)]
1617
[CmdletExample(

Commands/Admin/SetTenantSite.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
namespace SharePointPnP.PowerShell.Commands
1313
{
1414
[Cmdlet(VerbsCommon.Set, "PnPTenantSite")]
15-
[CmdletHelp(@"Uses the tenant API to set site information.",
15+
[CmdletHelp(@"Set site information.",
16+
"Sets site properties for existing sites.",
1617
SupportedPlatform = CmdletSupportedPlatform.Online,
1718
Category = CmdletHelpCategory.TenantAdmin)]
1819
[CmdletExample(

Commands/Apps/AddApp.cs

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#if !ONPREMISES
2+
using OfficeDevPnP.Core.ALM;
3+
using SharePointPnP.PowerShell.CmdletHelpAttributes;
4+
using System.Management.Automation;
5+
6+
namespace SharePointPnP.PowerShell.Commands.Apps
7+
{
8+
[Cmdlet(VerbsCommon.Add, "PnPApp")]
9+
[CmdletHelp("Add/uploads an available app to the app catalog",
10+
Category = CmdletHelpCategory.Apps, SupportedPlatform = CmdletSupportedPlatform.Online,
11+
OutputType = typeof(AppMetadata))]
12+
[CmdletExample(Code = @"PS:> Add-PnPApp -Path ./myapp.sppkg", Remarks = @"This will upload the specified app package to the app catalog", SortOrder = 1)]
13+
public class AddApp : PnPCmdlet
14+
{
15+
[Parameter(Mandatory = true, Position = 0, ValueFromPipeline = true, HelpMessage = "Specifies the Id or an actual app metadata instance")]
16+
public string Path;
17+
18+
protected override void ExecuteCmdlet()
19+
{
20+
if (!System.IO.Path.IsPathRooted(Path))
21+
{
22+
Path = System.IO.Path.Combine(SessionState.Path.CurrentFileSystemLocation.Path, Path);
23+
}
24+
25+
var fileInfo = new System.IO.FileInfo(Path);
26+
27+
var bytes = System.IO.File.ReadAllBytes(Path);
28+
29+
var manager = new AppManager(ClientContext);
30+
31+
var result = manager.Add(bytes, fileInfo.Name);
32+
33+
WriteObject(result);
34+
}
35+
}
36+
}
37+
#endif

Commands/Apps/GetApp.cs

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#if !ONPREMISES
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Management.Automation;
5+
using SharePointPnP.PowerShell.CmdletHelpAttributes;
6+
using SharePointPnP.PowerShell.Commands.Base.PipeBinds;
7+
using OfficeDevPnP.Core.ALM;
8+
9+
namespace SharePointPnP.PowerShell.Commands.Apps
10+
{
11+
[Cmdlet(VerbsCommon.Get, "PnPApp")]
12+
[CmdletHelp("Returns the available apps from the app catalog",
13+
Category = CmdletHelpCategory.Apps,
14+
OutputType = typeof(List<AppMetadata>), SupportedPlatform = CmdletSupportedPlatform.Online)]
15+
[CmdletExample(Code = @"PS:> Get-PnPAvailableApp", Remarks = @"This will return all available app metadata from the tenant app catalog. It will list the installed version in the current site.", SortOrder = 1)]
16+
[CmdletExample(Code = @"PS:> Get-PnPAvailableApp -Identity 2646ccc3-6a2b-46ef-9273-81411cbbb60f", Remarks = @"This will the specific app metadata from the app catalog.", SortOrder = 2)]
17+
public class GetApp : PnPCmdlet
18+
{
19+
[Parameter(Mandatory = false, Position = 0, ValueFromPipeline = true, HelpMessage = "Specifies the Id of an app which is available in the app catalog")]
20+
public GuidPipeBind Identity;
21+
22+
protected override void ExecuteCmdlet()
23+
{
24+
var manager = new AppManager(ClientContext);
25+
26+
var apps = manager.GetAvailable();
27+
if (MyInvocation.BoundParameters.ContainsKey("Identity"))
28+
{
29+
var app = apps.FirstOrDefault(a => a.Id == Identity.Id);
30+
31+
if (app != null)
32+
{
33+
WriteObject(app);
34+
}
35+
else
36+
{
37+
throw new System.Exception("App not found");
38+
}
39+
}
40+
else
41+
{
42+
WriteObject(apps);
43+
}
44+
}
45+
}
46+
}
47+
#endif

Commands/Apps/GetAppInstance.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
namespace SharePointPnP.PowerShell.Commands.Apps
99
{
1010
[Cmdlet(VerbsCommon.Get, "PnPAppInstance")]
11-
[CmdletHelp("Returns a SharePoint AddIn Instance in the site",
11+
[CmdletHelp("Returns a SharePoint AddIn Instance",
12+
"Returns a SharePoint App/Addin that has been installed in the current site",
1213
Category = CmdletHelpCategory.Apps,
1314
OutputType = typeof(List<AppInstance>),
1415
OutputTypeLink = "https://msdn.microsoft.com/en-us/library/microsoft.sharepoint.client.appinstance.aspx")]

0 commit comments

Comments
 (0)