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

Commit

Permalink
Merge pull request #1778 from SharePoint/dev
Browse files Browse the repository at this point in the history
November 2018 Release
  • Loading branch information
erwinvanhunen committed Nov 9, 2018
2 parents 7ed8ba9 + 3c3cbdf commit 082278c
Show file tree
Hide file tree
Showing 62 changed files with 1,195 additions and 431 deletions.
47 changes: 46 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,52 @@ All notable changes to this project will be documented in this file.

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

## [3.2.1810.0] Unreleased
## [3.4.1812.0]

### Added

### Changed

### Deprecated

### Contributors

## [3.3.1811.0]
### Added

### Changed
- Copy-PnPFile now supports special characters like '&' in file names
- Updated New-PnPSite to support language/locale for new sites.
- Updated documentation for New-PnPTenantSite
- Fixed documentation for Measure-PnPWeb, Set-PnPSite
- Updated samples
- Fixes issue with Set-PnPUnifiedGroup where if you only change for instance the displayname a private group would be marked as public.
- Renamed (and created aliases for the old cmdlet name) Apply-PnPProvisioningHierarchy to Apply-PnPTenantTemplate
- Renamed (and created aliases for the old cmdlet name) Add-PnPProvisioningSequence to Add-PnPTenantSequence
- Renamed (and created aliases for the old cmdlet name) Add-PnPProvisioningSite to Add-PnPTenantSequenceSite
- Renamed (and created aliases for the old cmdlet name) Add-PnPPnPProvisioningSubSite to Add-PnPTenantSequenceSubSite
- Renamed (and created aliases for the old cmdlet name) Get-PnPProvisioningSequence to Get-PnPTenantSequence
- Renamed (and created aliases for the old cmdlet name) Get-PnPProvisioningSite to Get-PnPTenantSequenceSite
- Renamed (and created aliases for the old cmdlet name) New-PnPProvisioningSequence to New-PnPTenantSequence
- Renamed (and created aliases for the old cmdlet name) New-PnPProvisioningTeamSite to New-PnPTenantSequenceTeamSite
- Renamed (and created aliases for the old cmdlet name) New-PnPProvisioningCommunicationSite to New-PnPTenantSequenceCommunicationSite
- Renamed (and created aliases for the old cmdlet name) New-PnPProvisioningTeamNoGroupSite to New-PnPTenantSequenceTeamNoGroupSite
- Renamed (and created aliases for the old cmdlet name) New-PnPProvisioningTeamNoGroupSubSite to New-PnPTenantSequenceTeamNoGroupSubSite
- Renamed (and created aliases for the old cmdlet name) New-PnPProvisioningHierarchy to New-PnPTenantTemplate
- Renamed (and created aliases for the old cmdlet name) Read-PnPProvisioningHierarchy to Read-PnPTenantTemplate
- Renamed (and created aliases for the old cmdlet name) Save-PnPProvisioningHierarchy to Save-PnPTenantTemplate
- Renamed (and created aliases for the old cmdlet name) Test-PnPProvisioningHierarchy to Test-PnPTenantTemplate

### Deprecated
- Marked Get-PnPProvisioningTemplateFromGallery as deprecated as the PnP Template Gallery has been shut down.

### Contributors
- Paul Bullock (pkbullock)
- François-Xavier Cat (lazywinadmin)
- Koen Zomers (KoenZomers)
- Kevin McDonnell (kevmcdonk)

## [3.2.1810.0] Released
### Added
- Add-PnPProvisioningSequence : Adds an in-memory sequence to an in-memory provisioning hierarchy
- Add-PnPProvisioningSite : Adds an in-memory site definition to a in-memory sequence
Expand Down
4 changes: 3 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ Please see following page for additional insights on the model.

## Building the source code ##

Once you have downloaded the code, in the folder with the PnP PowerShell source code, open the solution file SharePointPnP.PowerShell.sln.

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.

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

## Code contributions
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
compile it, make sure that PnP-Sites-Core is located at the same level as PnP-PowerShell.
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.

So:
```
Expand Down
12 changes: 6 additions & 6 deletions Commands/Admin/GrantHubSiteRights.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,26 @@
using SharePointPnP.PowerShell.CmdletHelpAttributes;
using SharePointPnP.PowerShell.Commands.Base;
using SharePointPnP.PowerShell.Commands.Base.PipeBinds;
using System;
using System.Management.Automation;

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

[Parameter(Mandatory = true)]
[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.")]
public string[] Principals { get; set; }

[Parameter(Mandatory = true)]
[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")]
public SPOHubSiteUserRights Rights { get; set; }

protected override void ExecuteCmdlet()
Expand Down
40 changes: 28 additions & 12 deletions Commands/Admin/NewSite.cs
Original file line number Diff line number Diff line change
@@ -1,20 +1,15 @@
#if !ONPREMISES
using System;
using System.Management.Automation;
using Microsoft.SharePoint.Client;
using OfficeDevPnP.Core;
using OfficeDevPnP.Core.Entities;
using SharePointPnP.PowerShell.CmdletHelpAttributes;
using SharePointPnP.PowerShell.Commands.Base;
using Resources = SharePointPnP.PowerShell.Commands.Properties.Resources;
using System.Threading.Tasks;
using SharePointPnP.PowerShell.Commands.Base.PipeBinds;
using SharePointPnP.PowerShell.Commands.Enums;
using System;

namespace SharePointPnP.PowerShell.Commands
{
[Cmdlet(VerbsCommon.New, "PnPSite")]
[CmdletHelp("BETA: This cmdlet is using early release APIs. Notice that functionality and parameters can change. Creates a new site collection",
[CmdletHelp("Creates a new site collection",
"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.",
OutputType = typeof(string),
OutputTypeDescription = "Returns the url of the newly created site collection",
Expand All @@ -36,17 +31,25 @@ namespace SharePointPnP.PowerShell.Commands
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""",
SortOrder = 4)]
[CmdletExample(
Code = @"PS:> New-PnPSite -Type CommunicationSite -Title Contoso -Url https://tenant.sharepoint.com/sites/contoso -AllowFileSharingForGuestUsers",
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.",
Code = @"PS:> New-PnPSite -Type CommunicationSite -Title Contoso -Url https://tenant.sharepoint.com/sites/contoso -ShareByEmailEnabled",
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.",
SortOrder = 5)]
[CmdletExample(
Code = @"PS:> New-PnPSite -Type CommunicationSite -Title Contoso -Url https://tenant.sharepoint.com/sites/contoso -Lcid 1044",
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.",
SortOrder = 6)]
[CmdletExample(
Code = @"PS:> New-PnPSite -Type TeamSite -Title 'Team Contoso' -Alias contoso",
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.",
SortOrder = 6)]
SortOrder = 7)]
[CmdletExample(
Code = @"PS:> New-PnPSite -Type TeamSite -Title 'Team Contoso' -Alias contoso -IsPublic",
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.",
SortOrder = 7)]
SortOrder = 8)]
[CmdletExample(
Code = @"PS:> New-PnPSite -Type TeamSite -Title 'Team Contoso' -Alias contoso -Lcid 1040",
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.",
SortOrder = 9)]
[CmdletAdditionalParameter(ParameterType = typeof(string), ParameterName = "Title", Mandatory = true, HelpMessage = @"Specifies the title of the new site collection", ParameterSetName = ParameterSet_COMMUNICATIONBUILTINDESIGN)]
[CmdletAdditionalParameter(ParameterType = typeof(string), ParameterName = "Title", Mandatory = true, HelpMessage = @"Specifies the title of the new site collection", ParameterSetName = ParameterSet_COMMUNICATIONCUSTOMDESIGN)]
[CmdletAdditionalParameter(ParameterType = typeof(string), ParameterName = "Url", Mandatory = true, HelpMessage = @"Specifies the full url of the new site collection", ParameterSetName = ParameterSet_COMMUNICATIONBUILTINDESIGN)]
Expand All @@ -61,6 +64,7 @@ namespace SharePointPnP.PowerShell.Commands
[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)]
[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)]
[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)]
[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)]
[CmdletAdditionalParameter(ParameterType = typeof(string), ParameterName = "Title", Mandatory = true, HelpMessage = @"Specifies the title of the new site collection", ParameterSetName = ParameterSet_TEAM)]
[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)]
[CmdletAdditionalParameter(ParameterType = typeof(string), ParameterName = "Description", Mandatory = false, HelpMessage = @"Specifies the description of the new site collection", ParameterSetName = ParameterSet_TEAM)]
Expand Down Expand Up @@ -110,7 +114,9 @@ protected override void ExecuteCmdlet()
creationInformation.Url = _communicationSiteParameters.Url;
creationInformation.Description = _communicationSiteParameters.Description;
creationInformation.Classification = _communicationSiteParameters.Classification;
creationInformation.AllowFileSharingForGuestUsers = _communicationSiteParameters.AllowFileSharingForGuestUsers;
#pragma warning disable CS0618 // Type or member is obsolete
creationInformation.ShareByEmailEnabled = _communicationSiteParameters.AllowFileSharingForGuestUsers || _communicationSiteParameters.ShareByEmailEnabled;
#pragma warning restore CS0618 // Type or member is obsolete
creationInformation.Lcid = _communicationSiteParameters.Lcid;
if (ParameterSetName == "CommunicationCustomInDesign")
{
Expand All @@ -132,6 +138,7 @@ protected override void ExecuteCmdlet()
creationInformation.Classification = _teamSiteParameters.Classification;
creationInformation.Description = _teamSiteParameters.Description;
creationInformation.IsPublic = _teamSiteParameters.IsPublic;
creationInformation.Lcid = _teamSiteParameters.Lcid;

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


[Parameter(Mandatory = false, ParameterSetName = ParameterSet_COMMUNICATIONBUILTINDESIGN)]
[Parameter(Mandatory = false, ParameterSetName = ParameterSet_COMMUNICATIONCUSTOMDESIGN)]
[Obsolete("Use ShareByEmailEnabled instead.")]
public SwitchParameter AllowFileSharingForGuestUsers;

[Parameter(Mandatory = false, ParameterSetName = ParameterSet_COMMUNICATIONBUILTINDESIGN)]
[Parameter(Mandatory = false, ParameterSetName = ParameterSet_COMMUNICATIONCUSTOMDESIGN)]
public SwitchParameter ShareByEmailEnabled;

[Parameter(Mandatory = false, ParameterSetName = ParameterSet_COMMUNICATIONBUILTINDESIGN)]
public OfficeDevPnP.Core.Sites.CommunicationSiteDesign SiteDesign = OfficeDevPnP.Core.Sites.CommunicationSiteDesign.Topic;

Expand Down Expand Up @@ -188,6 +201,9 @@ public class TeamSiteParameters

[Parameter(Mandatory = false, ParameterSetName = ParameterSet_TEAM)]
public SwitchParameter IsPublic;

[Parameter(Mandatory = false, ParameterSetName = ParameterSet_TEAM)]
public uint Lcid;
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions Commands/Admin/NewTenantSite.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ public class NewTenantSite : PnPAdminCmdlet
[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.")]
public string Owner = string.Empty;

[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")]
[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 ")]
public uint Lcid = 1033;

[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.")]
[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.")]
public string Template = "STS#0";

[Parameter(Mandatory = true, HelpMessage = "Use Get-PnPTimeZoneId to retrieve possible timezone values")]
Expand Down
4 changes: 2 additions & 2 deletions Commands/Apps/PublishApp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ namespace SharePointPnP.PowerShell.Commands.Apps
[CmdletHelp("Publishes/Deploys/Trusts an available app in the app catalog",
Category = CmdletHelpCategory.Apps, SupportedPlatform = CmdletSupportedPlatform.Online)]
[CmdletExample(
Code = @"PS:> Publish-PnPApp -Identity -Identity 2646ccc3-6a2b-46ef-9273-81411cbbb60f",
Code = @"PS:> Publish-PnPApp -Identity 2646ccc3-6a2b-46ef-9273-81411cbbb60f",
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)]
[CmdletExample(
Code = @"PS:> Publish-PnPApp -Identity -Identity 2646ccc3-6a2b-46ef-9273-81411cbbb60f -Scope Site",
Code = @"PS:> Publish-PnPApp -Identity 2646ccc3-6a2b-46ef-9273-81411cbbb60f -Scope Site",
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)]
public class PublishApp : PnPCmdlet
{
Expand Down
4 changes: 2 additions & 2 deletions Commands/Diagnostic/MeasurePnPWeb.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ namespace SharePointPnP.PowerShell.Commands.Diagnostic
Remarks = @"Gets statistics on the current web",
SortOrder = 1)]
[CmdletExample(
Code = @"PS:> Measure-PnPList $web -Recursive",
Remarks = @"Gets statistics on the chosen including all sub webs",
Code = @"PS:> Measure-PnPWeb $web -Recursive",
Remarks = @"Gets statistics on the provided web including all its subwebs",
SortOrder = 2)]

public class MeasurePnPWeb : PnPCmdlet
Expand Down
Loading

0 comments on commit 082278c

Please sign in to comment.