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 #2442 from SharePoint/dev
Browse files Browse the repository at this point in the history
January 2020 Release
  • Loading branch information
erwinvanhunen authored Jan 10, 2020
2 parents 8ecc5e5 + 14ce82e commit 2dbce5c
Show file tree
Hide file tree
Showing 92 changed files with 2,314 additions and 2,500 deletions.
Binary file modified Binaries/SharePointPnP.Modernization.Framework.dll
Binary file not shown.
635 changes: 403 additions & 232 deletions Binaries/SharePointPnP.Modernization.Framework.xml

Large diffs are not rendered by default.

Binary file modified Binaries/release/SharePointPnP.Modernization.Framework.dll
Binary file not shown.
635 changes: 403 additions & 232 deletions Binaries/release/SharePointPnP.Modernization.Framework.xml

Large diffs are not rendered by default.

62 changes: 37 additions & 25 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,37 +5,49 @@ 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.17.2001.0] (not yet released)
## [3.17.2001.0]

### Added
- Add/Remove/Set/Get-PnPApplicationCustomizer commands to allow working with SharePoint Framework Application Customizer Extensions [PR2312](https://github.com/SharePoint/PnP-PowerShell/pull/2312)
- Ability to pipe in a result from Get-PnPFolder to Get-PnPFolderItem using the -Identity parameter [PR2279](https://github.com/SharePoint/PnP-PowerShell/pull/2279)
- Added ability to pipe Get-PnPUnifiedGroup to Get-PnPUnifiedGroupOwners and Get-PnPUnifiedGroupMembers [PR2208](https://github.com/SharePoint/PnP-PowerShell/pull/2208)
- Added permissions required for each of the \*-PnPUnifiedGroup\* commands in the Azure Active Directory App Registration to the help text of the commands [PR2205](https://github.com/SharePoint/PnP-PowerShell/pull/2205)
- Added option to use Connect-PnPOnline with a base64 encoded private key for use in i.e. PnP PowerShell within an Azure Function v1 and an option to provide a certificate reference for use in i.e. Azure Function v2 [PR2201](https://github.com/SharePoint/PnP-PowerShell/pull/2201)
- Added option to use Connect-PnPOnline with a public key certificate for use in i.e. Azure Runbooks [PR2292](https://github.com/SharePoint/PnP-PowerShell/pull/2292)
- Added option -RowLimit to Get-PnPRecycleBinItem to avoid getting throttled on full recycle bins [PR2393](https://github.com/SharePoint/PnP-PowerShell/pull/2393)
- Added `-WriteToConsole` option to `Set-PnPTraceLog` to allow writing trace listener output from the PnP Templating commands to both the console and to a file. Doesn't work for .NET Core. [PR2161](https://github.com/SharePoint/PnP-PowerShell/pull/2161)
- Added `Reset-PnPLabel` command to allow removal of an Office 365 Retention Label from a list [PR2233](https://github.com/SharePoint/PnP-PowerShell/pull/2233)
- Add/Remove/Set/Get-PnPApplicationCustomizer commands to allow working with SharePoint Framework Application Customizer Extensions
- Ability to pipe in a result from Get-PnPFolder to Get-PnPFolderItem using the -Identity parameter
- Added ability to pipe Get-PnPUnifiedGroup to Get-PnPUnifiedGroupOwners and Get-PnPUnifiedGroupMembers
- Added permissions required for each of the \*-PnPUnifiedGroup\* commands in the Azure Active Directory App Registration to the help text of the commands
- Added option to use Connect-PnPOnline with a base64 encoded private key for use in i.e. PnP PowerShell within an Azure Function v1 and an option to provide a certificate reference for use in i.e. Azure Function v2
- Added option to use Connect-PnPOnline with a public key certificate for use in i.e. Azure Runbooks
- Added option -RowLimit to Get-PnPRecycleBinItem to avoid getting throttled on full recycle bins
- Added `-WriteToConsole` option to `Set-PnPTraceLog` to allow writing trace listener output from the PnP Templating commands to both the console and to a file. Doesn't work for .NET Core.
- Added `Reset-PnPLabel` command to allow removal of an Office 365 Retention Label from a list
- Add/Remove/Get-PnPOrgNewsSite commands to set site collections as authoritive news sources to SharePoint Online
- Add/Remove/Get-PnPOrgAssetsLibrary commands to set document libraries as organizational asset sources on SharePoint Online
- `-Recursive` option to `Get-PnPFolderItem` to allow retrieving all files and folders recursively

### Changed

- Fixes issues with connections not properly closing under some conditions when using Disconnect-PnPOnline [PR2207](https://github.com/SharePoint/PnP-PowerShell/pull/2207)
- When using commands that utilize the Graph API but not being connected to one of the Graph API Connect-PnPOnline methods, it would throw a NullReferenceException. It will now throw a cleaner exception indicating you should connect with the Graph API first. [PR2395](https://github.com/SharePoint/PnP-PowerShell/pull/2395)
- Fixed an issue where using Get-PnPUser -WithRightsAssigned would not return the proper users with actually having access to that site [PR1685](https://github.com/SharePoint/PnP-PowerShell/pull/1685)
- Fixed an issue when using ConvertTo-PnPClientSidePage to convert Delve Blog posts that it would throw a nullreference exception in some scenarios [PR2411](https://github.com/SharePoint/PnP-PowerShell/pull/2411)
- Fixed an issue using `Add-PnPDataRowsToProvisioningTemp` to add data from a list containing a multi choice to a PnP Provisioning Template where the data would be shown as `System.String[]` instead of the actual data [PR2064](https://github.com/SharePoint/PnP-PowerShell/pull/2064)
- Marked Get-PnPHealthScore as obsolete for SharePoint Online.
- Fixes issues with connections not properly closing under some conditions when using Disconnect-PnPOnline
- When using commands that utilize the Graph API but not being connected to one of the Graph API Connect-PnPOnline methods, it would throw a NullReferenceException. It will now throw a cleaner exception indicating you should connect with the Graph API first.
- Fixed an issue where using Get-PnPUser -WithRightsAssigned would not return the proper users with actually having access to that site
- Fixed an issue when using ConvertTo-PnPClientSidePage to convert Delve Blog posts that it would throw a nullreference exception in some scenarios
- Fixed an issue using `Add-PnPDataRowsToProvisioningTemp` to add data from a list containing a multi choice to a PnP Provisioning Template where the data would be shown as `System.String[]` instead of the actual data
- Bumped to .Net 4.6.1 as minimal .Net runtime version
- Changed the way properties are being set in Set-PnPField to support setting field specific properties such as the Lookup list on a Lookup field
- Fixed an issue where using Apply-PnPProvisioningTemplate -InputInstance $instance would throw a connectionString error if being executed from the root of a drive, i.e. c:\ or d:\
- Fixed issue with access token not returning correctly after update to newer version of NewtonSoft JSON.
- Fixes issue with pipeline not returning object correctly.

### Contributors
- Koen Zomers \[[koenzomers](https://github.com/koenzomers)\]
- Robin Meure \[[robinmeure](https://github.com/robinmeure)\]
- Michael Rees Pullen \[[mrpullen](https://github.com/mrpullen)\]
- Giacomo Pozzoni \[[jackpoz](https://github.com/jackpoz)\]
- Rene Modery \[[modery](https://github.com/modery)\]
- Krystian Niepsuj \[[MrDoNotBreak](https://github.com/MrDoNotBreak)\]
- Piotr Siatka \[[siata13](https://github.com/siata13)\]
- Heinrich Ulbricht \[[heinrich-ulbricht](https://github.com/heinrich-ulbricht)\]
- Dan Cecil \[[danielcecil](https://github.com/danielcecil)\]
- Koen Zomers [koenzomers]
- Robin Meure [robinmeure]
- Michael Rees Pullen [mrpullen]
- Giacomo Pozzoni [jackpoz]
- Rene Modery [modery]
- Krystian Niepsuj [MrDoNotBreak]
- Piotr Siatka [siata13]
- Heinrich Ulbricht [heinrich-ulbricht]
- Dan Cecil [danielcecil]
- Gautam Sheth [gautamdsheth]
- Giacomo Pozzoni [jackpoz]
- Will Holland [willholland]
- Ivan Vagunin [ivanvagunin]

## [3.16.1912.0]

Expand Down
42 changes: 42 additions & 0 deletions Commands/Admin/AddOrgAssetsLibrary.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#if !ONPREMISES
using Microsoft.SharePoint.Client;
using SharePointPnP.PowerShell.CmdletHelpAttributes;
using SharePointPnP.PowerShell.Commands.Base;
using System.Management.Automation;
using Microsoft.Online.SharePoint.TenantAdministration;

namespace SharePointPnP.PowerShell.Commands.Admin
{
[Cmdlet(VerbsCommon.Add, "PnPOrgAssetsLibrary")]
[CmdletHelp("Adds a given document library as a organizational asset source",
DetailedDescription = @"Adds a given document library as an organizational asset source in your Sharepoint Online Tenant. All organizational asset sources you add must reside in the same site collection. Document libraries specified as organizational asset must be enabled as an Office 365 CDN source, either as private or public. It may take some time before this change will be reflected in the webinterface.",
SupportedPlatform = CmdletSupportedPlatform.Online,
Category = CmdletHelpCategory.TenantAdmin)]
[CmdletExample(
Code = @"PS:> Add-PnPOrgAssetsLibrary -LibraryUrl https://yourtenant.sharepoint.com/sites/branding/logos",
Remarks = @"Adds the document library with the url ""logos"" located in the sitecollection at ""https://yourtenant.sharepoint.com/sites/branding"" as an organizational asset not specifying a thumbnail image for it and enabling the document library as a public Office 365 CDN source", SortOrder = 1)]
[CmdletExample(
Code = @"PS:> Add-PnPOrgAssetsLibrary -LibraryUrl https://yourtenant.sharepoint.com/sites/branding/logos -ThumbnailUrl https://yourtenant.sharepoint.com/sites/branding/logos/thumbnail.jpg",
Remarks = @"Adds the document library with the url ""logos"" located in the sitecollection at ""https://yourtenant.sharepoint.com/sites/branding"" as an organizational asset specifying the thumbnail image ""thumbnail.jpg"" residing in the same document library for it and enabling the document library as a public Office 365 CDN source", SortOrder = 2)]
[CmdletExample(
Code = @"PS:> Add-PnPOrgAssetsLibrary -LibraryUrl https://yourtenant.sharepoint.com/sites/branding/logos -CdnType Private",
Remarks = @"Adds the document library with the url ""logos"" located in the sitecollection at ""https://yourtenant.sharepoint.com/sites/branding"" as an organizational asset not specifying a thumbnail image for it and enabling the document library as a private Office 365 CDN source", SortOrder = 3)]
public class AddOrgAssetsLibrary : PnPAdminCmdlet
{
[Parameter(Mandatory = true, HelpMessage = "The full url of the document library to be marked as one of organization's assets sources")]
public string LibraryUrl;

[Parameter(Mandatory = false, HelpMessage = "The full url to an image that should be used as a thumbnail for showing this source. The image must reside in the same site as the document library you specify.")]
public string ThumbnailUrl;

[Parameter(Mandatory = false, HelpMessage = @"Indicates what type of Office 365 CDN source the document library will be added to")]
public SPOTenantCdnType CdnType = SPOTenantCdnType.Public;

protected override void ExecuteCmdlet()
{
Tenant.AddToOrgAssetsLibAndCdn(CdnType, LibraryUrl, ThumbnailUrl);
ClientContext.ExecuteQueryRetry();
}
}
}
#endif
29 changes: 29 additions & 0 deletions Commands/Admin/AddOrgNewsSite.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#if !ONPREMISES
using Microsoft.SharePoint.Client;
using SharePointPnP.PowerShell.CmdletHelpAttributes;
using SharePointPnP.PowerShell.Commands.Base;
using System.Management.Automation;
using SharePointPnP.PowerShell.Commands.Base.PipeBinds;

namespace SharePointPnP.PowerShell.Commands.Admin
{
[Cmdlet(VerbsCommon.Add, "PnPOrgNewsSite")]
[CmdletHelp("Adds the site as an organization news source in your tenant",
SupportedPlatform = CmdletSupportedPlatform.Online,
Category = CmdletHelpCategory.TenantAdmin)]
[CmdletExample(
Code = @"PS:> Add-PnPOrgNewsSite -OrgNewsSiteUrl https://yourtenant.sharepoint.com/sites/news",
Remarks = @"Adds the site as one of multiple possible tenant's organizational news sites", SortOrder = 1)]
public class AddOrgNewsSite : PnPAdminCmdlet
{
[Parameter(Mandatory = true, HelpMessage = "The url of the site to be marked as one of organization's news sites")]
public SitePipeBind OrgNewsSiteUrl;

protected override void ExecuteCmdlet()
{
Tenant.SetOrgNewsSite(OrgNewsSiteUrl.Url);
ClientContext.ExecuteQueryRetry();
}
}
}
#endif
30 changes: 30 additions & 0 deletions Commands/Admin/GetOrgAssetsLibrary.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#if !ONPREMISES
using Microsoft.SharePoint.Client;
using SharePointPnP.PowerShell.CmdletHelpAttributes;
using SharePointPnP.PowerShell.Commands.Base;
using System.Management.Automation;

namespace SharePointPnP.PowerShell.Commands.Admin
{
[Cmdlet(VerbsCommon.Get, "PnPOrgAssetsLibrary")]
[CmdletHelp("Returns the list of all the configured organizational asset libraries",
SupportedPlatform = CmdletSupportedPlatform.Online,
Category = CmdletHelpCategory.TenantAdmin)]
[CmdletExample(
Code = @"PS:> Get-PnPOrgAssetsLibrary",
Remarks = @"Returns the list of all the configured organizational asset sites", SortOrder = 1)]
[CmdletExample(
Code = @"PS:> (Get-PnPOrgAssetsLibrary)[0].OrgAssetsLibraries[0].LibraryUrl.DecodedUrl",
Remarks = @"Returns the server relative url of the first document library which has been flagged as organizational asset library, i.e. ""sites/branding/logos""", SortOrder = 2)]
//
public class GetOrgAssetsLibrary : PnPAdminCmdlet
{
protected override void ExecuteCmdlet()
{
var results = Tenant.GetOrgAssets();
ClientContext.ExecuteQueryRetry();
WriteObject(results.Value, true);
}
}
}
#endif
26 changes: 26 additions & 0 deletions Commands/Admin/GetOrgNewsSite.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#if !ONPREMISES
using Microsoft.SharePoint.Client;
using SharePointPnP.PowerShell.CmdletHelpAttributes;
using SharePointPnP.PowerShell.Commands.Base;
using System.Management.Automation;

namespace SharePointPnP.PowerShell.Commands.Admin
{
[Cmdlet(VerbsCommon.Get, "PnPOrgNewsSite")]
[CmdletHelp("Returns the list of all the configured organizational news sites.",
SupportedPlatform = CmdletSupportedPlatform.Online,
Category = CmdletHelpCategory.TenantAdmin)]
[CmdletExample(
Code = @"PS:> Get-PnPOrgNewsSite",
Remarks = @"Returns the list of all the configured organizational news sites.", SortOrder = 1)]
public class GetOrgNewsSite : PnPAdminCmdlet
{
protected override void ExecuteCmdlet()
{
var results = Tenant.GetOrgNewsSites();
ClientContext.ExecuteQueryRetry();
WriteObject(results, true);
}
}
}
#endif
4 changes: 4 additions & 0 deletions Commands/Admin/GetTenantId.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ protected override void ProcessRecord()
}
catch (Exception ex)
{
#if !NETSTANDARD2_1
if (ex.InnerException != null)
{
if (ex.InnerException is HttpException)
Expand All @@ -64,6 +65,9 @@ protected override void ProcessRecord()
{
throw ex;
}
#else
throw ex;
#endif
}
}
}
Expand Down
42 changes: 42 additions & 0 deletions Commands/Admin/RemoveOrgAssetsLibrary.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#if !ONPREMISES
using Microsoft.Online.SharePoint.TenantAdministration;
using Microsoft.SharePoint.Client;
using SharePointPnP.PowerShell.CmdletHelpAttributes;
using SharePointPnP.PowerShell.Commands.Base;
using System.Management.Automation;

namespace SharePointPnP.PowerShell.Commands.Admin
{
[Cmdlet(VerbsCommon.Remove, "PnPOrgAssetsLibrary")]
[CmdletHelp("Removes a given document library as a organizational asset source",
DetailedDescription = @"Removes a given document library as a organizational asset source based on its server relative URL in your Sharepoint Online Tenant. It will not remove the document library itself. It may take some time before this change will be reflected in the webinterface.",
SupportedPlatform = CmdletSupportedPlatform.Online,
Category = CmdletHelpCategory.TenantAdmin)]
[CmdletExample(
Code = @"PS:> Remove-PnPOrgAssetsLibrary -LibraryUrl ""sites/branding/logos""",
Remarks = @"This example removes the document library with the url ""logos"" residing in the sitecollection with the url ""sites/branding/logos"" from the list with organizational assets keeping it as an Office 365 CDN source", SortOrder = 1)]
[CmdletExample(
Code = @"PS:> Remove-PnPOrgAssetsLibrary -LibraryUrl ""sites/branding/logos"" -ShouldRemoveFromCdn $true",
Remarks = @"This example removes the document library with the url ""logos"" residing in the sitecollection with the url ""sites/branding/logos"" from the list with organizational assets also removing it as a Public Office 365 CDN source", SortOrder = 2)]
[CmdletExample(
Code = @"PS:> Remove-PnPOrgAssetsLibrary -LibraryUrl ""sites/branding/logos"" -ShouldRemoveFromCdn $true -CdnType Private",
Remarks = @"This example removes the document library with the url ""logos"" residing in the sitecollection with the url ""sites/branding/logos"" from the list with organizational assets also removing it as a Private Office 365 CDN source", SortOrder = 3)]
public class RemoveOrgAssetsLibrary : PnPAdminCmdlet
{
[Parameter(Mandatory = true, HelpMessage = @"The server relative url of the document library flagged as organizational asset which you want to remove, i.e. ""sites/branding/logos""")]
public string LibraryUrl;

[Parameter(Mandatory = false, HelpMessage = @"Boolean indicating if the document library that will no longer be flagged as an organizational asset also needs to be removed as an Office 365 CDN source")]
public bool ShouldRemoveFromCdn = false;

[Parameter(Mandatory = false, HelpMessage = @"Indicates what type of Office 365 CDN source the document library that will no longer be flagged as an organizational asset was of")]
public SPOTenantCdnType CdnType = SPOTenantCdnType.Public;

protected override void ExecuteCmdlet()
{
Tenant.RemoveFromOrgAssetsAndCdn(ShouldRemoveFromCdn, CdnType, LibraryUrl);
ClientContext.ExecuteQueryRetry();
}
}
}
#endif
31 changes: 31 additions & 0 deletions Commands/Admin/RemoveOrgNewsSite.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#if !ONPREMISES
using Microsoft.Online.SharePoint.TenantAdministration;
using Microsoft.SharePoint.Client;
using SharePointPnP.PowerShell.CmdletHelpAttributes;
using SharePointPnP.PowerShell.Commands.Base;
using System.Management.Automation;
using SharePointPnP.PowerShell.Commands.Base.PipeBinds;

namespace SharePointPnP.PowerShell.Commands.Admin
{
[Cmdlet(VerbsCommon.Remove, "PnPOrgNewsSite")]
[CmdletHelp("Removes a given site from the list of organizational news sites.",
DetailedDescription = @"Removes a given site from the list of organizational news sites based on its URL in your Sharepoint Online Tenant.",
SupportedPlatform = CmdletSupportedPlatform.Online,
Category = CmdletHelpCategory.TenantAdmin)]
[CmdletExample(
Code = @"PS:> Remove-PnPOrgNewsSite -OrgNewsSiteUrl https://tenant.sharepoint.com/sites/mysite",
Remarks = @"This example removes the specified site from list of organization's news sites.", SortOrder = 1)]
public class RemoveOrgNewsSite : PnPAdminCmdlet
{
[Parameter(Mandatory = true, HelpMessage = @"The site to be removed from list of organization's news sites")]
public SitePipeBind OrgNewsSiteUrl;

protected override void ExecuteCmdlet()
{
Tenant.RemoveOrgNewsSite(OrgNewsSiteUrl.Url);
ClientContext.ExecuteQueryRetry();
}
}
}
#endif
2 changes: 1 addition & 1 deletion Commands/Admin/RemoveSiteCollectionAppCatalog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ namespace SharePointPnP.PowerShell.Commands.Admin
SupportedPlatform = CmdletSupportedPlatform.Online,
Category = CmdletHelpCategory.TenantAdmin)]
[CmdletExample(
Code = @"PS:> Remove-PnPOffice365GroupToSite -Url ""https://contoso.sharepoint.com/sites/FinanceTeamsite""",
Code = @"PS:> Remove-PnPSiteCollectionAppCatalog -Site ""https://contoso.sharepoint.com/sites/FinanceTeamsite""",
Remarks = @"This will remove a SiteCollection app catalog from the specified site", SortOrder = 1)]
public class RemoveSiteCollectionAppCatalog: PnPAdminCmdlet
{
Expand Down
Loading

0 comments on commit 2dbce5c

Please sign in to comment.