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

Commit 7b39366

Browse files
Merge pull request #553 from OfficeDev/dev
November 2016 Release
2 parents 79562e1 + 95a3616 commit 7b39366

File tree

416 files changed

+4788
-2134
lines changed

Some content is hidden

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

416 files changed

+4788
-2134
lines changed

.github/ISSUE_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
###Notice: many issues / bugs reported are actually related to the PnP Core Library which is used behind the scenes. Consider carefully where to report an issue:###
22

33
1. **Are you using ```Apply-SPOProvisioningTemplate``` or ```Get-SPOProvisioningTemplate```**? The issue is most likely related to the Provisioning Engine. The Provisioning engine is _not_ located in the PowerShell repo. Please report the issue here: https://github.com/officedev/PnP-Sites-Core/issues.
4-
2. **Is the issue related to the cmdlet itself, its parameters, the syntax, or do you suspect it's the code of the cmdlet that is causing the issue?** Then please continue reporting the issue in this repo.
4+
2. **Is the issue related to the cmdlet itself, its parameters, the syntax, or do you suspect it is the code of the cmdlet that is causing the issue?** Then please continue reporting the issue in this repo.
55
3. **If you think that the functionality might be related to the underlying libraries that the cmdlet is calling** (We realize that that might be difficult to determine), please first double check the code of the cmdlet, which can be found here: https://github.com/OfficeDev/PnP-PowerShell/tree/master/Commands. If related to the cmdlet, continue reporting the issue here, otherwise report the issue at https://github.com/officedev/PnP-Sites-Core/issues
66

77
### Reporting an Issue or Missing Feature

CmdletHelpGenerator/CmdletInfo.cs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,9 @@ public class CmdletInfo
2525
public string OutputTypeDescription { get; set; }
2626
public string OutputTypeLink { get; set; }
2727

28-
public string FullCommand
29-
{
30-
get
31-
{
32-
return string.Format("{0}-{1}", Verb, Noun);
33-
}
34-
}
28+
public List<string> Aliases { get; set; }
29+
30+
public string FullCommand => $"{Verb}-{Noun}";
3531

3632
public string Category { get; set; }
3733

@@ -41,6 +37,7 @@ public CmdletInfo(string verb, string noun)
4137
Noun = noun;
4238
Parameters = new List<CmdletParameterInfo>();
4339
Syntaxes = new List<CmdletSyntax>();
40+
Aliases = new List<string>();
4441
}
4542
}
4643
}

CmdletHelpGenerator/Program.cs

Lines changed: 184 additions & 16 deletions
Large diffs are not rendered by default.

Commands/Admin/GetTenantSite.cs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#if !ONPREMISES
2+
using System;
23
using System.ComponentModel;
34
using System.Linq;
45
using System.Management.Automation;
@@ -11,15 +12,16 @@
1112
namespace SharePointPnP.PowerShell.Commands
1213
{
1314

14-
[Cmdlet(VerbsCommon.Get, "SPOTenantSite", SupportsShouldProcess = true)]
15+
[Cmdlet(VerbsCommon.Get, "PnPTenantSite", SupportsShouldProcess = true)]
16+
[CmdletAlias("Get-SPOTenantSite")]
1517
[CmdletHelp(@"Office365 only: Uses the tenant API to retrieve site information.",
1618
Category = CmdletHelpCategory.TenantAdmin,
1719
OutputType = typeof(Microsoft.Online.SharePoint.TenantAdministration.SiteProperties),
1820
OutputTypeLink = "https://msdn.microsoft.com/en-us/library/microsoft.online.sharepoint.tenantadministration.siteproperties.aspx")]
19-
[CmdletExample(Code = @"PS:> Get-SPOTenantSite", Remarks = "Returns all site collections", SortOrder = 1)]
20-
[CmdletExample(Code = @"PS:> Get-SPOTenantSite -Url http://tenant.sharepoint.com/sites/projects", Remarks = "Returns information about the project site.",SortOrder = 2)]
21-
[CmdletExample(Code = @"PS:> Get-SPOTenantSite -Detailed", Remarks = "Returns all sites with the full details of these sites", SortOrder = 3)]
22-
[CmdletExample(Code = @"PS:> Get-SPOTenantSite -IncludeOneDriveSites", Remarks = "Returns all sites including all OneDrive 4 Business sites", SortOrder = 4)]
21+
[CmdletExample(Code = @"PS:> Get-PnPTenantSite", Remarks = "Returns all site collections", SortOrder = 1)]
22+
[CmdletExample(Code = @"PS:> Get-PnPTenantSite -Url http://tenant.sharepoint.com/sites/projects", Remarks = "Returns information about the project site.",SortOrder = 2)]
23+
[CmdletExample(Code = @"PS:> Get-PnPTenantSite -Detailed", Remarks = "Returns all sites with the full details of these sites", SortOrder = 3)]
24+
[CmdletExample(Code = @"PS:> Get-PnPTenantSite -IncludeOneDriveSites", Remarks = "Returns all sites including all OneDrive 4 Business sites", SortOrder = 4)]
2325
public class GetTenantSite : SPOAdminCmdlet
2426
{
2527
[Parameter(Mandatory = false, HelpMessage = "The URL of the site", Position = 0, ValueFromPipeline = true)]
@@ -77,6 +79,5 @@ protected override void ExecuteCmdlet()
7779
}
7880
}
7981
}
80-
8182
}
8283
#endif

Commands/Admin/GetTimeZoneId.cs

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,22 @@
66

77
namespace SharePointPnP.PowerShell.Commands
88
{
9-
[Cmdlet(VerbsCommon.Get, "SPOTimeZoneId")]
10-
[CmdletHelp("Returns a time zone ID",
11-
Category = CmdletHelpCategory.TenantAdmin,
12-
OutputType = typeof(IEnumerable<Zone>),
13-
OutputTypeDescription = "Returns a list of matching zones. Use the ID property of the object for use in New-SPOTenantSite")]
14-
[CmdletExample(Code = @"PS:> Get-SPOTimeZoneId",Remarks = @"This will return all time zone IDs in use by Office 365.", SortOrder = 1)]
15-
[CmdletExample(Code = @"PS:> Get-SPOTimeZoneId -Match Stockholm", Remarks = @"This will return the time zone IDs for Stockholm", SortOrder = 2)]
9+
[Cmdlet(VerbsCommon.Get, "PnPTimeZoneId")]
10+
[CmdletAlias("Get-SPOTimeZoneId")]
11+
[CmdletHelp("Returns a time zone ID",
12+
Category = CmdletHelpCategory.TenantAdmin,
13+
OutputType = typeof(IEnumerable<Zone>),
14+
OutputTypeDescription =
15+
"Returns a list of matching zones. Use the ID property of the object for use in New-SPOTenantSite")]
16+
[CmdletExample(Code = @"PS:> Get-PnPTimeZoneId",
17+
Remarks = @"This will return all time zone IDs in use by Office 365.", SortOrder = 1)]
18+
[CmdletExample(Code = @"PS:> Get-PnPTimeZoneId -Match Stockholm",
19+
Remarks = @"This will return the time zone IDs for Stockholm", SortOrder = 2)]
1620
public class GetTimeZoneId : PSCmdlet
1721
{
18-
[Parameter(Mandatory = false, Position=0, HelpMessage = "A string to search for like 'Stockholm'")]
19-
public string Match;
22+
[Parameter(Mandatory = false, Position = 0, HelpMessage = "A string to search for like 'Stockholm'")]
23+
public
24+
string Match;
2025

2126
protected override void ProcessRecord()
2227
{
@@ -34,7 +39,11 @@ private IEnumerable<Zone> FindZone(string match)
3439
{
3540
var zones = AllZones();
3641

37-
var results = zones.Where(x => x.Description.ToLower().IndexOf(match.ToLower(), StringComparison.Ordinal) > -1 || x.Identifier.ToLower().Contains(match.ToLower()));
42+
var results =
43+
zones.Where(
44+
x =>
45+
x.Description.ToLower().IndexOf(match.ToLower(), StringComparison.Ordinal) > -1 ||
46+
x.Identifier.ToLower().Contains(match.ToLower()));
3847

3948
return results;
4049
}
@@ -50,7 +59,8 @@ public IEnumerable<Zone> AllZones()
5059
identifier = identifier.Replace("PLUS", "+").Replace("MINUS", "-");
5160
if (identifier.Length > 3)
5261
{
53-
identifier = identifier.Substring(0, identifier.Length - 2) + ":" + identifier.Substring(identifier.Length - 2, 2);
62+
identifier = identifier.Substring(0, identifier.Length - 2) + ":" +
63+
identifier.Substring(identifier.Length - 2, 2);
5464
}
5565

5666
description = description.Substring(description.IndexOf('_') + 1).Replace("_", " ");

Commands/Admin/GetWebTemplates.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
11
#if !ONPREMISES
2+
using System;
23
using SharePointPnP.PowerShell.CmdletHelpAttributes;
34
using Microsoft.SharePoint.Client;
45
using SharePointPnP.PowerShell.Commands.Base;
56
using System.Management.Automation;
67

78
namespace SharePointPnP.PowerShell.Commands
89
{
9-
[Cmdlet(VerbsCommon.Get, "SPOWebTemplates")]
10+
[Cmdlet(VerbsCommon.Get, "PnPWebTemplates")]
11+
[CmdletAlias("Get-SPOWebTemplates")]
1012
[CmdletHelp(@"Office365 only: Returns the available web templates.",
1113
Category = CmdletHelpCategory.TenantAdmin,
1214
OutputType=typeof(Microsoft.Online.SharePoint.TenantAdministration.SPOTenantWebTemplateCollection),
1315
OutputTypeLink = "https://msdn.microsoft.com/en-us/library/microsoft.online.sharepoint.tenantadministration.spotenantwebtemplatecollection.aspx")]
14-
[CmdletExample(Code = @"PS:> Get-SPOWebTemplates", SortOrder = 1)]
15-
[CmdletExample(Code = @"PS:> Get-SPOWebTemplates -LCID 1033", Remarks = @"Returns all webtemplates for the Locale with ID 1033 (English)", SortOrder = 2)]
16-
[CmdletExample(Code = @"PS:> Get-SPOWebTemplates -CompatibilityLevel 15", Remarks = @"Returns all webtemplates for the compatibility level 15", SortOrder = 2)]
16+
[CmdletExample(Code = @"PS:> Get-PnPWebTemplates", SortOrder = 1)]
17+
[CmdletExample(Code = @"PS:> Get-PnPWebTemplates -LCID 1033", Remarks = @"Returns all webtemplates for the Locale with ID 1033 (English)", SortOrder = 2)]
18+
[CmdletExample(Code = @"PS:> Get-PnPWebTemplates -CompatibilityLevel 15", Remarks = @"Returns all webtemplates for the compatibility level 15", SortOrder = 2)]
1719
[CmdletRelatedLink(Text = "Locale IDs", Url = "http://go.microsoft.com/fwlink/p/?LinkId=242911Id=242911")]
1820
public class GetWebTemplates : SPOAdminCmdlet
1921
{

Commands/Admin/NewTenantSite.cs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,14 @@
66

77
namespace SharePointPnP.PowerShell.Commands
88
{
9-
[Cmdlet(VerbsCommon.New, "SPOTenantSite")]
9+
[Cmdlet(VerbsCommon.New, "PnPTenantSite")]
10+
[CmdletAlias("New-SPOTenantSite")]
1011
[CmdletHelp("Creates a new site collection for the current tenant",
11-
DetailedDescription = @"The New-SPOTenantSite cmdlet creates a new site collection for the current company. However, creating a new SharePoint
12+
DetailedDescription = @"The New-PnPTenantSite cmdlet creates a new site collection for the current company. However, creating a new SharePoint
1213
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 ",
1314
Category = CmdletHelpCategory.TenantAdmin)]
1415
[CmdletExample(
15-
Code = @"PS:> New-SPOTenantSite -Title Contoso -Url https://tenant.sharepoint.com/sites/contoso -Owner [email protected] -TimeZone 4",
16+
Code = @"PS:> New-PnPTenantSite -Title Contoso -Url https://tenant.sharepoint.com/sites/contoso -Owner [email protected] -TimeZone 4",
1617
Remarks = @"This will add a site collection with the title 'Contoso', the url 'https://tenant.sharepoint.com/sites/contoso', the timezone 'UTC+01:00' and the owner '[email protected]'", SortOrder = 1)]
1718
[CmdletRelatedLink(
1819
Text ="Locale IDs",
@@ -40,10 +41,10 @@ public class NewTenantSite : SPOAdminCmdlet
4041
[Parameter(Mandatory = false, HelpMessage = @"Specifies the language of this site collection. For more information, see Locale IDs Assigned by Microsoft: http://go.microsoft.com/fwlink/p/?LinkId=242911Id=242911.")]
4142
public uint Lcid = 1033;
4243

43-
[Parameter(Mandatory = false, HelpMessage = @"Specifies the site collection template type. Use the Get-SPOWebTemplate cmdlet to get the list of valid templates. If no template is specified, one can be added later. The Template and LocaleId parameters must be a valid combination as returned from the Get-SPOnlineWebTemplate cmdlet.")]
44+
[Parameter(Mandatory = false, HelpMessage = @"Specifies the site collection template type. Use the Get-PnPWebTemplate cmdlet to get the list of valid templates. If no template is specified, one can be added later. The Template and LocaleId parameters must be a valid combination as returned from the Get-PnPWebTemplates cmdlet.")]
4445
public string Template = "STS#0";
4546

46-
[Parameter(Mandatory = true, HelpMessage = "Use Get-SPOTimeZoneId to retrieve possible timezone values")]
47+
[Parameter(Mandatory = true, HelpMessage = "Use Get-PnPTimeZoneId to retrieve possible timezone values")]
4748
public int TimeZone;
4849

4950
[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.")]

Commands/Admin/RemoveTenantSite.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,18 @@
88

99
namespace SharePointPnP.PowerShell.Commands
1010
{
11-
[Cmdlet(VerbsCommon.Remove, "SPOTenantSite", ConfirmImpact = ConfirmImpact.High, SupportsShouldProcess = true)]
11+
[Cmdlet(VerbsCommon.Remove, "PnPTenantSite", ConfirmImpact = ConfirmImpact.High, SupportsShouldProcess = true)]
12+
[CmdletAlias("Remove-SPOTenantSite")]
1213
[CmdletHelp("Office365 only: Removes a site collection from the current tenant",
1314
Category = CmdletHelpCategory.TenantAdmin)]
1415
[CmdletExample(
15-
Code = @"PS:> Remove-SPOTenantSite -Url https://tenant.sharepoint.com/sites/contoso",
16+
Code = @"PS:> Remove-PnPTenantSite -Url https://tenant.sharepoint.com/sites/contoso",
1617
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)]
1718
[CmdletExample(
18-
Code = @"PS:> Remove-SPOTenantSite -Url https://tenant.sharepoint.com/sites/contoso -Force -SkipRecycleBin",
19+
Code = @"PS:> Remove-PnPTenantSite -Url https://tenant.sharepoint.com/sites/contoso -Force -SkipRecycleBin",
1920
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)]
2021
[CmdletExample(
21-
Code = @"PS:> Remove-SPOTenantSite -Url https://tenant.sharepoint.com/sites/contoso -FromRecycleBin",
22+
Code = @"PS:> Remove-PnPTenantSite -Url https://tenant.sharepoint.com/sites/contoso -FromRecycleBin",
2223
Remarks = @"This will remove the site collection with the url 'https://tenant.sharepoint.com/sites/contoso' from the recycle bin.", SortOrder = 3)]
2324
public class RemoveSite : SPOAdminCmdlet
2425
{

Commands/Admin/SetTenantSite.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,18 @@
1010

1111
namespace SharePointPnP.PowerShell.Commands
1212
{
13-
[Cmdlet(VerbsCommon.Set, "SPOTenantSite")]
13+
[Cmdlet(VerbsCommon.Set, "PnPTenantSite")]
14+
[CmdletAlias("Set-SPOTenantSite")]
1415
[CmdletHelp(@"Office365 only: Uses the tenant API to set site information.",
1516
Category = CmdletHelpCategory.TenantAdmin)]
1617
[CmdletExample(
17-
Code = @"PS:> Set-SPOTenantSite -Url https://contoso.sharepoint.com -Title 'Contoso Website' -Sharing Disabled",
18+
Code = @"PS:> Set-PnPTenantSite -Url https://contoso.sharepoint.com -Title 'Contoso Website' -Sharing Disabled",
1819
Remarks = @"This will set the title of the site collection with the URL 'https://contoso.sharepoint.com' to 'Contoso Website' and disable sharing on this site collection.", SortOrder = 1)]
1920
[CmdletExample(
20-
Code = @"PS:> Set-SPOTenantSite -Url https://contoso.sharepoint.com -Title 'Contoso Website' -StorageWarningLevel 8000 -StorageMaximumLevel 10000",
21+
Code = @"PS:> Set-PnPTenantSite -Url https://contoso.sharepoint.com -Title 'Contoso Website' -StorageWarningLevel 8000 -StorageMaximumLevel 10000",
2122
Remarks = @"This will set the title of the site collection with the URL 'https://contoso.sharepoint.com' to 'Contoso Website', set the storage warning level to 8GB and set the storage maximum level to 10GB.", SortOrder = 2)]
2223
[CmdletExample(
23-
Code = @"PS:> Set-SPOTenantSite -Url https://contoso.sharepoint.com/sites/sales -Owners 'i:0#.f|membership|[email protected]'",
24+
Code = @"PS:> Set-PnPTenantSite -Url https://contoso.sharepoint.com/sites/sales -Owners '[email protected]'",
2425
Remarks = @"This will set [email protected] as a site collection owner at 'https://contoso.sharepoint.com/sites/sales'.", SortOrder = 3)]
2526
public class SetTenantSite : SPOAdminCmdlet
2627
{

Commands/Apps/GetAppInstance.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,14 @@
66

77
namespace SharePointPnP.PowerShell.Commands
88
{
9-
[Cmdlet(VerbsCommon.Get, "SPOAppInstance")]
9+
[Cmdlet(VerbsCommon.Get, "PnPAppInstance")]
10+
[CmdletAlias("Get-SPOAppInstance")]
1011
[CmdletHelp("Returns a SharePoint AddIn Instance in the site",
1112
Category = CmdletHelpCategory.Apps,
1213
OutputType= typeof(List<AppInstance>),
1314
OutputTypeLink = "https://msdn.microsoft.com/en-us/library/microsoft.sharepoint.client.appinstance.aspx")]
14-
[CmdletExample(Code = @"PS:> Get-SPOAppInstance", Remarks = @"This will return all addin instances in the site.", SortOrder = 1)]
15-
[CmdletExample(Code = @"PS:> Get-SPOAppInstance -Identity 99a00f6e-fb81-4dc7-8eac-e09c6f9132fe", Remarks = @"This will return an addin instance with the specified id.", SortOrder = 2)]
15+
[CmdletExample(Code = @"PS:> Get-PnPAppInstance", Remarks = @"This will return all addin instances in the site.", SortOrder = 1)]
16+
[CmdletExample(Code = @"PS:> Get-PnPAppInstance -Identity 99a00f6e-fb81-4dc7-8eac-e09c6f9132fe", Remarks = @"This will return an addin instance with the specified id.", SortOrder = 2)]
1617
public class GetAppInstance : SPOWebCmdlet
1718
{
1819
[Parameter(Mandatory = false, Position=0, ValueFromPipeline = true, HelpMessage = "Specifies the Id of the App Instance")]

0 commit comments

Comments
 (0)