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

Commit 082278c

Browse files
Merge pull request #1778 from SharePoint/dev
November 2018 Release
2 parents 7ed8ba9 + 3c3cbdf commit 082278c

File tree

62 files changed

+1195
-431
lines changed

Some content is hidden

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

62 files changed

+1195
-431
lines changed

CHANGELOG.md

+46-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,52 @@ All notable changes to this project will be documented in this file.
55

66
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
77

8-
## [3.2.1810.0] Unreleased
8+
## [3.4.1812.0]
9+
10+
### Added
11+
12+
### Changed
13+
14+
### Deprecated
15+
16+
### Contributors
17+
18+
## [3.3.1811.0]
19+
### Added
20+
21+
### Changed
22+
- Copy-PnPFile now supports special characters like '&' in file names
23+
- Updated New-PnPSite to support language/locale for new sites.
24+
- Updated documentation for New-PnPTenantSite
25+
- Fixed documentation for Measure-PnPWeb, Set-PnPSite
26+
- Updated samples
27+
- Fixes issue with Set-PnPUnifiedGroup where if you only change for instance the displayname a private group would be marked as public.
28+
- Renamed (and created aliases for the old cmdlet name) Apply-PnPProvisioningHierarchy to Apply-PnPTenantTemplate
29+
- Renamed (and created aliases for the old cmdlet name) Add-PnPProvisioningSequence to Add-PnPTenantSequence
30+
- Renamed (and created aliases for the old cmdlet name) Add-PnPProvisioningSite to Add-PnPTenantSequenceSite
31+
- Renamed (and created aliases for the old cmdlet name) Add-PnPPnPProvisioningSubSite to Add-PnPTenantSequenceSubSite
32+
- Renamed (and created aliases for the old cmdlet name) Get-PnPProvisioningSequence to Get-PnPTenantSequence
33+
- Renamed (and created aliases for the old cmdlet name) Get-PnPProvisioningSite to Get-PnPTenantSequenceSite
34+
- Renamed (and created aliases for the old cmdlet name) New-PnPProvisioningSequence to New-PnPTenantSequence
35+
- Renamed (and created aliases for the old cmdlet name) New-PnPProvisioningTeamSite to New-PnPTenantSequenceTeamSite
36+
- Renamed (and created aliases for the old cmdlet name) New-PnPProvisioningCommunicationSite to New-PnPTenantSequenceCommunicationSite
37+
- Renamed (and created aliases for the old cmdlet name) New-PnPProvisioningTeamNoGroupSite to New-PnPTenantSequenceTeamNoGroupSite
38+
- Renamed (and created aliases for the old cmdlet name) New-PnPProvisioningTeamNoGroupSubSite to New-PnPTenantSequenceTeamNoGroupSubSite
39+
- Renamed (and created aliases for the old cmdlet name) New-PnPProvisioningHierarchy to New-PnPTenantTemplate
40+
- Renamed (and created aliases for the old cmdlet name) Read-PnPProvisioningHierarchy to Read-PnPTenantTemplate
41+
- Renamed (and created aliases for the old cmdlet name) Save-PnPProvisioningHierarchy to Save-PnPTenantTemplate
42+
- Renamed (and created aliases for the old cmdlet name) Test-PnPProvisioningHierarchy to Test-PnPTenantTemplate
43+
44+
### Deprecated
45+
- Marked Get-PnPProvisioningTemplateFromGallery as deprecated as the PnP Template Gallery has been shut down.
46+
47+
### Contributors
48+
- Paul Bullock (pkbullock)
49+
- François-Xavier Cat (lazywinadmin)
50+
- Koen Zomers (KoenZomers)
51+
- Kevin McDonnell (kevmcdonk)
52+
53+
## [3.2.1810.0] Released
954
### Added
1055
- Add-PnPProvisioningSequence : Adds an in-memory sequence to an in-memory provisioning hierarchy
1156
- Add-PnPProvisioningSite : Adds an in-memory site definition to a in-memory sequence

CONTRIBUTING.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ Please see following page for additional insights on the model.
1414

1515
## Building the source code ##
1616

17+
Once you have downloaded the code, in the folder with the PnP PowerShell source code, open the solution file SharePointPnP.PowerShell.sln.
18+
1719
If you have set up up the projects and you are ready to build the source code, make sure to build the SharePointPnP.PowerShellModuleFilesGenerator project first. This project will be executed after every build and it will generate the required PSD1 and XML files with cmdlet documentation in them.
1820

1921
When you build the solution a postbuild script will copy the required files to a folder in your users folder called
@@ -23,7 +25,7 @@ To debug the cmdlets: launch PowerShell and attach Visual Studio to the powershe
2325

2426
## Code contributions
2527
In order to succesfully compile the PnP PowerShell solution you will _also_ have to download *and build in Visual Studio* the [PnP-Sites-Core](https://github.com/OfficeDev/PnP-Sites-Core) repository and make the dev branch available. The PowerShell solution depends on it. In order to succesfully
26-
compile it, make sure that PnP-Sites-Core is located at the same level as PnP-PowerShell.
28+
compile it, make sure that PnP-Sites-Core is located at the same level as PnP-PowerShell and you open the solution file OfficeDevPnP.Core.sln located in the Core subfolder of the sourcecode.
2729

2830
So:
2931
```

Commands/Admin/GrantHubSiteRights.cs

+6-6
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,26 @@
44
using SharePointPnP.PowerShell.CmdletHelpAttributes;
55
using SharePointPnP.PowerShell.Commands.Base;
66
using SharePointPnP.PowerShell.Commands.Base.PipeBinds;
7-
using System;
87
using System.Management.Automation;
98

109
namespace SharePointPnP.PowerShell.Commands.Admin
1110
{
1211
[Cmdlet(VerbsSecurity.Grant, "PnPHubSiteRights")]
13-
[CmdletHelp(@"Grant Permissions to associate sites to Hub Sites.",
12+
[CmdletHelp(@"Grant additional permissions to the permissions already in place to associate sites to Hub Sites for one or more specific users",
1413
Category = CmdletHelpCategory.TenantAdmin,
1514
SupportedPlatform = CmdletSupportedPlatform.Online)]
16-
[CmdletExample(Code = @"PS:> Grant-PnPHubSiteRights -Identity https://contoso.sharepoint.com/sites/hubsite -Principals ""[email protected]"",""[email protected]"" -Rights Join", Remarks = "This example shows how to grant right to myuser and myotheruser to associate their sites with hubsite", SortOrder = 1)]
15+
[CmdletExample(Code = @"PS:> Grant-PnPHubSiteRights -Identity https://contoso.sharepoint.com/sites/hubsite -Principals ""[email protected]"",""[email protected]"" -Rights Join", Remarks = "This example shows how to grant rights to myuser and myotheruser to associate their sites with the provided Hub Site", SortOrder = 1)]
16+
[CmdletExample(Code = @"PS:> Grant-PnPHubSiteRights -Identity https://contoso.sharepoint.com/sites/hubsite -Principals ""[email protected]"" -Rights None", Remarks = "This example shows how to revoke rights from myuser to associate their sites with the provided Hub Site", SortOrder = 2)]
1717
public class GrantHubSiteRights : PnPAdminCmdlet
1818
{
19-
[Parameter(Position = 0, ValueFromPipeline = true, Mandatory = true)]
19+
[Parameter(Position = 0, ValueFromPipeline = true, Mandatory = true, HelpMessage = "The Hub Site to set the permissions on to associate another site with this Hub Site")]
2020
[Alias("HubSite")]
2121
public HubSitePipeBind Identity { get; set; }
2222

23-
[Parameter(Mandatory = true)]
23+
[Parameter(Mandatory = true, HelpMessage = "One or more usernames that will be given or revoked the permission to associate a site with this Hub Site. It does not replace permissions given out before but adds to the already existing permissions.")]
2424
public string[] Principals { get; set; }
2525

26-
[Parameter(Mandatory = true)]
26+
[Parameter(Mandatory = true, HelpMessage = "Provide Join to give permissions to associate a site with this Hub Site or use None to revoke the permissions for the user(s) specified with the Principals argument")]
2727
public SPOHubSiteUserRights Rights { get; set; }
2828

2929
protected override void ExecuteCmdlet()

Commands/Admin/NewSite.cs

+28-12
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,15 @@
11
#if !ONPREMISES
2-
using System;
32
using System.Management.Automation;
43
using Microsoft.SharePoint.Client;
5-
using OfficeDevPnP.Core;
6-
using OfficeDevPnP.Core.Entities;
74
using SharePointPnP.PowerShell.CmdletHelpAttributes;
8-
using SharePointPnP.PowerShell.Commands.Base;
9-
using Resources = SharePointPnP.PowerShell.Commands.Properties.Resources;
10-
using System.Threading.Tasks;
115
using SharePointPnP.PowerShell.Commands.Base.PipeBinds;
126
using SharePointPnP.PowerShell.Commands.Enums;
7+
using System;
138

149
namespace SharePointPnP.PowerShell.Commands
1510
{
1611
[Cmdlet(VerbsCommon.New, "PnPSite")]
17-
[CmdletHelp("BETA: This cmdlet is using early release APIs. Notice that functionality and parameters can change. Creates a new site collection",
12+
[CmdletHelp("Creates a new site collection",
1813
"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.",
1914
OutputType = typeof(string),
2015
OutputTypeDescription = "Returns the url of the newly created site collection",
@@ -36,17 +31,25 @@ namespace SharePointPnP.PowerShell.Commands
3631
Remarks = @"This will create a new Communications Site collection with the title 'Contoso' and the url 'https://tenant.sharepoint.com/sites/contoso'. The classification for the site will be set to ""HBI""",
3732
SortOrder = 4)]
3833
[CmdletExample(
39-
Code = @"PS:> New-PnPSite -Type CommunicationSite -Title Contoso -Url https://tenant.sharepoint.com/sites/contoso -AllowFileSharingForGuestUsers",
40-
Remarks = @"This will create a new Communications Site collection with the title 'Contoso' and the url 'https://tenant.sharepoint.com/sites/contoso'. File sharing for guest users will be enabled.",
34+
Code = @"PS:> New-PnPSite -Type CommunicationSite -Title Contoso -Url https://tenant.sharepoint.com/sites/contoso -ShareByEmailEnabled",
35+
Remarks = @"This will create a new Communications Site collection with the title 'Contoso' and the url 'https://tenant.sharepoint.com/sites/contoso'. Allows owners to invite users outside of the organization.",
4136
SortOrder = 5)]
37+
[CmdletExample(
38+
Code = @"PS:> New-PnPSite -Type CommunicationSite -Title Contoso -Url https://tenant.sharepoint.com/sites/contoso -Lcid 1044",
39+
Remarks = @"This will create a new Communications Site collection with the title 'Contoso' and the url 'https://tenant.sharepoint.com/sites/contoso' and sets the default language to Italian.",
40+
SortOrder = 6)]
4241
[CmdletExample(
4342
Code = @"PS:> New-PnPSite -Type TeamSite -Title 'Team Contoso' -Alias contoso",
4443
Remarks = @"This will create a new Modern Team Site collection with the title 'Team Contoso' and the url 'https://tenant.sharepoint.com/sites/contoso' or 'https://tenant.sharepoint.com/teams/contoso' based on the managed path configuration in the SharePoint Online Admin portal.",
45-
SortOrder = 6)]
44+
SortOrder = 7)]
4645
[CmdletExample(
4746
Code = @"PS:> New-PnPSite -Type TeamSite -Title 'Team Contoso' -Alias contoso -IsPublic",
4847
Remarks = @"This will create a new Modern Team Site collection with the title 'Team Contoso' and the url 'https://tenant.sharepoint.com/sites/contoso' or 'https://tenant.sharepoint.com/teams/contoso' based on the managed path configuration in the SharePoint Online Admin portal and sets the site to public.",
49-
SortOrder = 7)]
48+
SortOrder = 8)]
49+
[CmdletExample(
50+
Code = @"PS:> New-PnPSite -Type TeamSite -Title 'Team Contoso' -Alias contoso -Lcid 1040",
51+
Remarks = @"This will create a new Modern Team Site collection with the title 'Team Contoso' and the url 'https://tenant.sharepoint.com/sites/contoso' or 'https://tenant.sharepoint.com/teams/contoso' based on the managed path configuration in the SharePoint Online Admin portal and sets the default language of the site to Italian.",
52+
SortOrder = 9)]
5053
[CmdletAdditionalParameter(ParameterType = typeof(string), ParameterName = "Title", Mandatory = true, HelpMessage = @"Specifies the title of the new site collection", ParameterSetName = ParameterSet_COMMUNICATIONBUILTINDESIGN)]
5154
[CmdletAdditionalParameter(ParameterType = typeof(string), ParameterName = "Title", Mandatory = true, HelpMessage = @"Specifies the title of the new site collection", ParameterSetName = ParameterSet_COMMUNICATIONCUSTOMDESIGN)]
5255
[CmdletAdditionalParameter(ParameterType = typeof(string), ParameterName = "Url", Mandatory = true, HelpMessage = @"Specifies the full url of the new site collection", ParameterSetName = ParameterSet_COMMUNICATIONBUILTINDESIGN)]
@@ -61,6 +64,7 @@ namespace SharePointPnP.PowerShell.Commands
6164
[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 = ParameterSet_COMMUNICATIONCUSTOMDESIGN)]
6265
[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 = ParameterSet_COMMUNICATIONBUILTINDESIGN)]
6366
[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 = ParameterSet_COMMUNICATIONCUSTOMDESIGN)]
67+
[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 = ParameterSet_TEAM)]
6468
[CmdletAdditionalParameter(ParameterType = typeof(string), ParameterName = "Title", Mandatory = true, HelpMessage = @"Specifies the title of the new site collection", ParameterSetName = ParameterSet_TEAM)]
6569
[CmdletAdditionalParameter(ParameterType = typeof(string), ParameterName = "Alias", Mandatory = true, HelpMessage = @"Specifies the alias of the new site collection which represents the part of the URL that will be assigned to the site behind 'https://tenant.sharepoint.com/sites/' or 'https://tenant.sharepoint.com/teams/' based on the managed path configuration in the SharePoint Online Admin portal", ParameterSetName = ParameterSet_TEAM)]
6670
[CmdletAdditionalParameter(ParameterType = typeof(string), ParameterName = "Description", Mandatory = false, HelpMessage = @"Specifies the description of the new site collection", ParameterSetName = ParameterSet_TEAM)]
@@ -110,7 +114,9 @@ protected override void ExecuteCmdlet()
110114
creationInformation.Url = _communicationSiteParameters.Url;
111115
creationInformation.Description = _communicationSiteParameters.Description;
112116
creationInformation.Classification = _communicationSiteParameters.Classification;
113-
creationInformation.AllowFileSharingForGuestUsers = _communicationSiteParameters.AllowFileSharingForGuestUsers;
117+
#pragma warning disable CS0618 // Type or member is obsolete
118+
creationInformation.ShareByEmailEnabled = _communicationSiteParameters.AllowFileSharingForGuestUsers || _communicationSiteParameters.ShareByEmailEnabled;
119+
#pragma warning restore CS0618 // Type or member is obsolete
114120
creationInformation.Lcid = _communicationSiteParameters.Lcid;
115121
if (ParameterSetName == "CommunicationCustomInDesign")
116122
{
@@ -132,6 +138,7 @@ protected override void ExecuteCmdlet()
132138
creationInformation.Classification = _teamSiteParameters.Classification;
133139
creationInformation.Description = _teamSiteParameters.Description;
134140
creationInformation.IsPublic = _teamSiteParameters.IsPublic;
141+
creationInformation.Lcid = _teamSiteParameters.Lcid;
135142

136143
var results = ClientContext.CreateSiteAsync(creationInformation);
137144
var returnedContext = results.GetAwaiter().GetResult();
@@ -157,10 +164,16 @@ public class CommunicationSiteParameters
157164
[Parameter(Mandatory = false, ParameterSetName = ParameterSet_COMMUNICATIONCUSTOMDESIGN)]
158165
public string Classification;
159166

167+
160168
[Parameter(Mandatory = false, ParameterSetName = ParameterSet_COMMUNICATIONBUILTINDESIGN)]
161169
[Parameter(Mandatory = false, ParameterSetName = ParameterSet_COMMUNICATIONCUSTOMDESIGN)]
170+
[Obsolete("Use ShareByEmailEnabled instead.")]
162171
public SwitchParameter AllowFileSharingForGuestUsers;
163172

173+
[Parameter(Mandatory = false, ParameterSetName = ParameterSet_COMMUNICATIONBUILTINDESIGN)]
174+
[Parameter(Mandatory = false, ParameterSetName = ParameterSet_COMMUNICATIONCUSTOMDESIGN)]
175+
public SwitchParameter ShareByEmailEnabled;
176+
164177
[Parameter(Mandatory = false, ParameterSetName = ParameterSet_COMMUNICATIONBUILTINDESIGN)]
165178
public OfficeDevPnP.Core.Sites.CommunicationSiteDesign SiteDesign = OfficeDevPnP.Core.Sites.CommunicationSiteDesign.Topic;
166179

@@ -188,6 +201,9 @@ public class TeamSiteParameters
188201

189202
[Parameter(Mandatory = false, ParameterSetName = ParameterSet_TEAM)]
190203
public SwitchParameter IsPublic;
204+
205+
[Parameter(Mandatory = false, ParameterSetName = ParameterSet_TEAM)]
206+
public uint Lcid;
191207
}
192208
}
193209
}

Commands/Admin/NewTenantSite.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@ public class NewTenantSite : PnPAdminCmdlet
4646
[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.")]
4747
public string Owner = string.Empty;
4848

49-
[Parameter(Mandatory = false, HelpMessage = @"Specifies the language of this site collection. For more information, see Locale IDs Assigned by Microsoft: https://msdn.microsoft.com/en-us/library/microsoft.sharepoint.splanguage.lcid.aspx")]
49+
[Parameter(Mandatory = false, HelpMessage = @"Specifies the language of this site collection. For more information, see Locale IDs Assigned by Microsoft: https://msdn.microsoft.com/en-us/library/microsoft.sharepoint.splanguage.lcid.aspx. To get the list of supported languages use: (Get-PnPWeb -Includes RegionalSettings.InstalledLanguages).RegionalSettings.InstalledLanguages ")]
5050
public uint Lcid = 1033;
5151

52-
[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.")]
52+
[Parameter(Mandatory = false, HelpMessage = @"Specifies the site collection template type. Use the Get-PnPWebTemplates 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.")]
5353
public string Template = "STS#0";
5454

5555
[Parameter(Mandatory = true, HelpMessage = "Use Get-PnPTimeZoneId to retrieve possible timezone values")]

Commands/Apps/PublishApp.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ namespace SharePointPnP.PowerShell.Commands.Apps
1111
[CmdletHelp("Publishes/Deploys/Trusts an available app in the app catalog",
1212
Category = CmdletHelpCategory.Apps, SupportedPlatform = CmdletSupportedPlatform.Online)]
1313
[CmdletExample(
14-
Code = @"PS:> Publish-PnPApp -Identity -Identity 2646ccc3-6a2b-46ef-9273-81411cbbb60f",
14+
Code = @"PS:> Publish-PnPApp -Identity 2646ccc3-6a2b-46ef-9273-81411cbbb60f",
1515
Remarks = @"This will deploy/trust an app into the app catalog. Notice that the app needs to be available in the tenant scoped app catalog", SortOrder = 1)]
1616
[CmdletExample(
17-
Code = @"PS:> Publish-PnPApp -Identity -Identity 2646ccc3-6a2b-46ef-9273-81411cbbb60f -Scope Site",
17+
Code = @"PS:> Publish-PnPApp -Identity 2646ccc3-6a2b-46ef-9273-81411cbbb60f -Scope Site",
1818
Remarks = @"This will deploy/trust an app into the app catalog. Notice that the app needs to be available in the site collection scoped app catalog", SortOrder = 1)]
1919
public class PublishApp : PnPCmdlet
2020
{

Commands/Diagnostic/MeasurePnPWeb.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ namespace SharePointPnP.PowerShell.Commands.Diagnostic
1919
Remarks = @"Gets statistics on the current web",
2020
SortOrder = 1)]
2121
[CmdletExample(
22-
Code = @"PS:> Measure-PnPList $web -Recursive",
23-
Remarks = @"Gets statistics on the chosen including all sub webs",
22+
Code = @"PS:> Measure-PnPWeb $web -Recursive",
23+
Remarks = @"Gets statistics on the provided web including all its subwebs",
2424
SortOrder = 2)]
2525

2626
public class MeasurePnPWeb : PnPCmdlet

0 commit comments

Comments
 (0)