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

Commit dcb5981

Browse files
Merge pull request #1505 from SharePoint/dev
April 2018 Release
2 parents 7056528 + 44f9fd7 commit dcb5981

File tree

56 files changed

+1504
-237
lines changed

Some content is hidden

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

56 files changed

+1504
-237
lines changed

CHANGELOG.md

+49
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,55 @@ 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+
## [2.25.1804.0] - Unreleased
9+
### Added
10+
- Added -Tree parameter to Get-PnPNavigationNode which will return a tree representation of the selected navigation structure
11+
- Added -Parent parameter which takes an ID to Add-PnPNavigationNode instead of using the -Header parameter
12+
- Added -Scope parameter to Add-PnPApp, Get-PnPApp, Install-PnPApp, Publish-PnPApp, Remove-PnPApp, Uninstall-PnPApp, Unpublish-PnPApp, Update-PnPApp to support site collection app catalog
13+
- Added -Wait parameter to Install-PnPApp which will wait for the installation to finish
14+
- Added Get-PnPHideDefaultThemes cmdlet
15+
- Added Set-PnPHideDefaultThemes cmdlet
16+
- Added Get-PnPListRecordDeclaration cmdlet
17+
- Added Set-PnPListRecordDeclaration cmdlet
18+
- Added Get-PnPInPlaceRecordsManagement cmdlet
19+
- Added Get-PnPInformationRightsManagement cmdlet
20+
- Added Set-PnPInformationRightsManagement cmdlet
21+
- Added New-PnPUPABulkImportJob cmdlet
22+
- Added Get-PnPUPABulkImportStatus cmdlet
23+
24+
### Changed
25+
26+
- Added additional properties to Set-PnPList: Description, EnableFolderCreation, ForceCheckout, ListExperience
27+
- ALM Cmdlets (Add-PnPApp, etc.) now allow for specifying the app title instead of only an id.
28+
- Updated Set-PnPInPlaceRecordsManagement cmdlet to use a -Enabled parameter instead of -On and -Off
29+
- Add-PnPClientSideWebPart and Add-PnPClientSideText now return the client side component added
30+
- Fixed issue with Set-PnPTenantTheme not recognizing a parameter value accordingly
31+
- Added -HideDefaultThemes parameter to Set-PnPTenant
32+
- Get-PnPTenant now returns if default themes are hidden or not
33+
- Added ability to cancel Device Login requests with CTRL+C
34+
- Renamed Connect-PnPHubSite to Add-PnPHubSiteAssociation and added alias for Connect-PnPHubSite
35+
- Renamed Disconnect-PnPHubSite to Remove-PnPHubSiteAssociation and added alias for Disconnect-PnPHubSite
36+
- Fixed output of File/Folder objects which caused the creation of an error message that was not thrown to the output but was available in the $error built-in variable
37+
- Fixed Set-PnPUserProfileProperty cmdlet to accept $null values to clear properties
38+
- Fixed Invoke-PnPSiteDesign where you connected to the -admin URL, and it ignored the WebUrl parameter when applying the site design
39+
- Added WebUrl parameter to Set-PnPWebTheme to support connection via -admin URL needed by app-only connections
40+
- Fixed issue with
41+
42+
### Deprecated
43+
- Deprecated -Header parameter on Add-PnPNavigationNode in favor or -Parent [Id]
44+
- Deprecated Disable-PnPInPlaceRecordsManagementForSite in favor of Set-PnPInPlaceRecordsManagement -Enabled $true
45+
- Deprecated Enabled-PnPInPlaceRecordsManagementForSite in favor of Set-PnPInPlaceRecordsManagement -Disabled $true
46+
- Deprecated Connect-PnPHubSite. Use Add-PnPHubSiteAssociation
47+
- Deprecated Disconnect-PnPHubSite. Use Remove-PnPHubSiteAssociation
48+
49+
### Contributors
50+
casselc
51+
stevebeauge
52+
velingeorgiev
53+
cebud
54+
jensotto
55+
56+
857
## [2.24.1803.0] - 2018-03-06
958
### Added
1059
- Added Get-PnPTenant cmdlet

Commands/Admin/ConnectHubSite.cs renamed to Commands/Admin/AddHubSiteAssociation.cs

+4-3
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,16 @@
1010

1111
namespace SharePointPnP.PowerShell.Commands.Admin
1212
{
13-
[Cmdlet(VerbsCommunications.Connect, "PnPHubSite")]
13+
[Cmdlet(VerbsCommon.Add, "PnPHubSiteAssociation")]
14+
[Alias("Connect-PnPHubSite")]
1415
[CmdletHelp("Connects a site to a hubsite.",
1516
DetailedDescription = @"Connects an existing site to a hubsite",
1617
SupportedPlatform = CmdletSupportedPlatform.Online,
1718
Category = CmdletHelpCategory.TenantAdmin)]
1819
[CmdletExample(
19-
Code = @"PS:> Connect-PnPHubSite -Site https://tenant.sharepoint.com/sites/mysite -HubSite https://tenant.sharepoint.com/sites/hubsite",
20+
Code = @"PS:> Add-PnPHubSiteAssociation -Site https://tenant.sharepoint.com/sites/mysite -HubSite https://tenant.sharepoint.com/sites/hubsite",
2021
Remarks = @"This example adds the specified site to the hubsite.", SortOrder = 1)]
21-
public class ConnectHubSite : PnPAdminCmdlet
22+
public class AddHubSiteAssociation : PnPAdminCmdlet
2223
{
2324
[Parameter(Mandatory = true, HelpMessage = @"The site to connect to the hubsite")]
2425
public SitePipeBind Site;
+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#if !ONPREMISES
2+
using Microsoft.Online.SharePoint.TenantAdministration;
3+
using Microsoft.SharePoint.Client;
4+
using SharePointPnP.PowerShell.CmdletHelpAttributes;
5+
using SharePointPnP.PowerShell.Commands.Base;
6+
using System.Management.Automation;
7+
using OfficeDevPnP.Core.Sites;
8+
using SharePointPnP.PowerShell.Commands.Base.PipeBinds;
9+
using System;
10+
using SharePointPnP.PowerShell.Commands.Enums;
11+
using System.Collections.Generic;
12+
using SharePointPnP.PowerShell.Commands.Model;
13+
14+
namespace SharePointPnP.PowerShell.Commands.Admin
15+
{
16+
[Cmdlet(VerbsCommon.Get, "PnPHideDefaultThemes")]
17+
[CmdletHelp(@"Returns if the default / OOTB themes should be visible to users or not.",
18+
DetailedDescription = @"Returns if the default themes are visible. Use Set-PnPHideDefaultThemes to change this value.
19+
20+
You must be a SharePoint Online global administrator to run the cmdlet.",
21+
SupportedPlatform = CmdletSupportedPlatform.Online,
22+
Category = CmdletHelpCategory.TenantAdmin)]
23+
[CmdletExample(
24+
Code = @"PS:> Get-PnPHideDefaultThemes",
25+
Remarks = @"This example returns the current setting if the default themes should be visible", SortOrder = 1)]
26+
public class GetHideDefaultThemes : PnPAdminCmdlet
27+
{
28+
protected override void ExecuteCmdlet()
29+
{
30+
var value = Tenant.EnsureProperty(t => t.HideDefaultThemes);
31+
WriteObject(value);
32+
}
33+
}
34+
}
35+
#endif

Commands/Admin/GetTenant.cs

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ public class GetTenant : PnPAdminCmdlet
3131
protected override void ExecuteCmdlet()
3232
{
3333
ClientContext.Load(Tenant);
34+
ClientContext.Load(Tenant, t => t.HideDefaultThemes);
3435
ClientContext.ExecuteQueryRetry();
3536
WriteObject(new SPOTenant(Tenant));
3637
}

Commands/Admin/DisconnectHubSite.cs renamed to Commands/Admin/RemoveHubSiteAssociation.cs

+4-3
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,16 @@
1010

1111
namespace SharePointPnP.PowerShell.Commands.Admin
1212
{
13-
[Cmdlet(VerbsCommunications.Disconnect, "PnPHubSite")]
13+
[Cmdlet(VerbsCommon.Remove, "PnPHubSiteAssociation")]
14+
[Alias("Disconnect-PnPHubSite")]
1415
[CmdletHelp("Disconnects a site from a hubsite.",
1516
DetailedDescription = @"Disconnects an site from a hubsite",
1617
SupportedPlatform = CmdletSupportedPlatform.Online,
1718
Category = CmdletHelpCategory.TenantAdmin)]
1819
[CmdletExample(
19-
Code = @"PS:> Disconnect-PnPHubSite -Site https://tenant.sharepoint.com/sites/mysite -HubSite https://tenant.sharepoint.com/sites/hubsite",
20+
Code = @"PS:> Remove-PnPHubSiteAssociation -Site https://tenant.sharepoint.com/sites/mysite -HubSite https://tenant.sharepoint.com/sites/hubsite",
2021
Remarks = @"This example adds the specified site to the hubsite.", SortOrder = 1)]
21-
public class DisconnectHubSite : PnPAdminCmdlet
22+
public class RemoveHubSiteAssociation : PnPAdminCmdlet
2223
{
2324
[Parameter(Mandatory = true, HelpMessage = @"The site to disconnect from its hubsite")]
2425
public SitePipeBind Site;
+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#if !ONPREMISES
2+
using Microsoft.Online.SharePoint.TenantAdministration;
3+
using Microsoft.SharePoint.Client;
4+
using SharePointPnP.PowerShell.CmdletHelpAttributes;
5+
using SharePointPnP.PowerShell.Commands.Base;
6+
using System.Management.Automation;
7+
using OfficeDevPnP.Core.Sites;
8+
using SharePointPnP.PowerShell.Commands.Base.PipeBinds;
9+
using System;
10+
using SharePointPnP.PowerShell.Commands.Enums;
11+
using System.Collections.Generic;
12+
using SharePointPnP.PowerShell.Commands.Model;
13+
14+
namespace SharePointPnP.PowerShell.Commands.Admin
15+
{
16+
[Cmdlet(VerbsCommon.Set, "PnPHideDefaultThemes")]
17+
[CmdletHelp(@"Defines if the default / OOTB themes should be visible to users or not.",
18+
DetailedDescription = @"Use this cmdlet to hide or show the default themes to users
19+
20+
You must be a SharePoint Online global administrator to run the cmdlet.",
21+
SupportedPlatform = CmdletSupportedPlatform.Online,
22+
Category = CmdletHelpCategory.TenantAdmin)]
23+
[CmdletExample(
24+
Code = @"PS:> Set-PnPHideDefaultThemes -HideDefaultThemes $true",
25+
Remarks = @"This example hides the default themes", SortOrder = 1)]
26+
[CmdletExample(
27+
Code = @"PS:> Set-PnPHideDefaultThemes -HideDefaultThemes $false",
28+
Remarks = @"This example shows the default themes", SortOrder = 1)]
29+
public class SetHideDefaultThemes : PnPAdminCmdlet
30+
{
31+
[Parameter(Mandatory = true, HelpMessage = "Defines if the default themes should be visible or hidden")]
32+
public bool HideDefaultThemes = false;
33+
34+
protected override void ExecuteCmdlet()
35+
{
36+
Tenant.HideDefaultThemes = HideDefaultThemes;
37+
ClientContext.ExecuteQueryRetry();
38+
}
39+
}
40+
}
41+
#endif

Commands/Admin/SetTenant.cs

+11-5
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,10 @@
1010
namespace SharePointPnP.PowerShell.Commands.Admin
1111
{
1212
[Cmdlet(VerbsCommon.Set, "PnPTenant", DefaultParameterSetName = ParameterAttribute.AllParameterSets)]
13-
[CmdletHelp(@"Returns organization-level site collection properties",
14-
DetailedDescription = @"Returns organization-level site collection properties such as StorageQuota, StorageQuotaAllocated, ResourceQuota,
13+
[CmdletHelp(@"Sets organization-level site collection properties",
14+
DetailedDescription = @"Sets organization-level site collection properties such as StorageQuota, StorageQuotaAllocated, ResourceQuota,
1515
ResourceQuotaAllocated, and SiteCreationMode.
1616
17-
Currently, there are no parameters for this cmdlet.
18-
1917
You must be a SharePoint Online global administrator to run the cmdlet.",
2018
SupportedPlatform = CmdletSupportedPlatform.Online,
2119
Category = CmdletHelpCategory.TenantAdmin)]
@@ -401,6 +399,9 @@ The only two characters that can be managed at this time are the # and % charact
401399
[Parameter(Mandatory = false)]
402400
public int? EmailAttestationReAuthDays;
403401

402+
[Parameter(Mandatory = false, HelpMessage = "Defines if the default themes are visible or hidden")]
403+
public bool? HideDefaultThemes;
404+
404405
protected override void ExecuteCmdlet()
405406
{
406407
ClientContext.Load(Tenant);
@@ -632,7 +633,7 @@ protected override void ExecuteCmdlet()
632633
Tenant.DisallowInfectedFileDownload = DisallowInfectedFileDownload.Value;
633634
isDirty = true;
634635
}
635-
if (string.IsNullOrEmpty(SharingBlockedDomainList))
636+
if (!string.IsNullOrEmpty(SharingBlockedDomainList))
636637
{
637638
if (!Tenant.RequireAcceptingAccountMatchInvitedAccount)
638639
{
@@ -952,6 +953,11 @@ protected override void ExecuteCmdlet()
952953
}
953954
isDirty = true;
954955
}
956+
if(HideDefaultThemes.HasValue)
957+
{
958+
Tenant.HideDefaultThemes = HideDefaultThemes.Value;
959+
isDirty = true;
960+
}
955961
if (isDirty)
956962
{
957963
ClientContext.ExecuteQueryRetry();

Commands/Admin/SetTenantCdnPolicy.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,18 @@ namespace SharePointPnP.PowerShell.Commands.Admin
1818
SupportedPlatform = CmdletSupportedPlatform.Online,
1919
Category = CmdletHelpCategory.TenantAdmin)]
2020
[CmdletExample(
21-
Code = @"PS:> Set-PnPTenantCdnPolicies -CdnType Public -PolicyType IncludeFileExtensions -PolicyValue ""CSS,EOT,GIF,ICO,JPEG,JPG,JS,MAP,PNG,SVG,TTF,WOFF""",
21+
Code = @"PS:> Set-PnPTenantCdnPolicy -CdnType Public -PolicyType IncludeFileExtensions -PolicyValue ""CSS,EOT,GIF,ICO,JPEG,JPG,JS,MAP,PNG,SVG,TTF,WOFF""",
2222
Remarks = @"This example sets the IncludeFileExtensions policy to the specified value.", SortOrder = 1)]
2323
public class SetTenantCdnPolicy : PnPAdminCmdlet
2424
{
2525
[Parameter(Mandatory = true, HelpMessage = "The type of cdn to retrieve the policies from")]
2626
public SPOTenantCdnType CdnType;
2727

2828
[Parameter(Mandatory = true, HelpMessage = "The type of the policy to set")]
29-
public SPOTenantCdnPolicyType PolicyType { get; set; }
29+
public SPOTenantCdnPolicyType PolicyType;
3030

3131
[Parameter(Mandatory = true, HelpMessage = "The value of the policy to set")]
32-
public string PolicyValue { get; set; }
32+
public string PolicyValue;
3333

3434
protected override void ExecuteCmdlet()
3535
{

Commands/Apps/AddApp.cs

+10-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#if !ONPREMISES
22
using OfficeDevPnP.Core.ALM;
3+
using OfficeDevPnP.Core.Enums;
34
using SharePointPnP.PowerShell.CmdletHelpAttributes;
5+
using SharePointPnP.PowerShell.Commands.Enums;
46
using System.Management.Automation;
57

68
namespace SharePointPnP.PowerShell.Commands.Apps
@@ -15,6 +17,9 @@ namespace SharePointPnP.PowerShell.Commands.Apps
1517
[CmdletExample(
1618
Code = @"PS:> Add-PnPApp -Path ./myapp.sppkg -Publish",
1719
Remarks = @"This will upload the specified app package to the app catalog and deploy/trust it at the same time.", SortOrder = 2)]
20+
[CmdletExample(
21+
Code = @"PS:> Add-PnPApp -Path ./myapp.sppkg -Scope Site -Publish",
22+
Remarks = @"This will upload the specified app package to the site collection app catalog and deploy/trust it at the same time.", SortOrder = 2)]
1823
public class AddApp : PnPCmdlet
1924
{
2025
private const string ParameterSet_ADD = "Add only";
@@ -24,6 +29,9 @@ public class AddApp : PnPCmdlet
2429
[Parameter(Mandatory = true, Position = 0, ParameterSetName = ParameterSet_PUBLISH, ValueFromPipeline = true, HelpMessage = "Specifies the Id or an actual app metadata instance")]
2530
public string Path;
2631

32+
[Parameter(Mandatory = false, HelpMessage = "Defines which app catalog to use. Defaults to Tenant")]
33+
public AppCatalogScope Scope = AppCatalogScope.Tenant;
34+
2735
[Parameter(Mandatory = true, ValueFromPipeline = false, ParameterSetName = ParameterSet_PUBLISH, HelpMessage = "This will deploy/trust an app into the app catalog")]
2836
public SwitchParameter Publish;
2937

@@ -46,7 +54,7 @@ protected override void ExecuteCmdlet()
4654

4755
var manager = new AppManager(ClientContext);
4856

49-
var result = manager.Add(bytes, fileInfo.Name, Overwrite);
57+
var result = manager.Add(bytes, fileInfo.Name, Overwrite, Scope);
5058

5159
try
5260
{
@@ -55,7 +63,7 @@ protected override void ExecuteCmdlet()
5563
{
5664
if (manager.Deploy(result, SkipFeatureDeployment))
5765
{
58-
result = manager.GetAvailable(result.Id);
66+
result = manager.GetAvailable(result.Id, Scope);
5967
}
6068

6169
}

Commands/Apps/GetApp.cs

+21-14
Original file line numberDiff line numberDiff line change
@@ -6,46 +6,53 @@
66
using SharePointPnP.PowerShell.Commands.Base.PipeBinds;
77
using OfficeDevPnP.Core.ALM;
88
using System;
9+
using SharePointPnP.PowerShell.Commands.Enums;
10+
using OfficeDevPnP.Core.Enums;
911

1012
namespace SharePointPnP.PowerShell.Commands.Apps
1113
{
1214
[Cmdlet(VerbsCommon.Get, "PnPApp")]
1315
[CmdletHelp("Returns the available apps from the app catalog",
1416
Category = CmdletHelpCategory.Apps,
1517
OutputType = typeof(List<AppMetadata>), SupportedPlatform = CmdletSupportedPlatform.Online)]
16-
[CmdletExample(Code = @"PS:> Get-PnPApp", 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)]
17-
[CmdletExample(Code = @"PS:> Get-PnPApp -Identity 2646ccc3-6a2b-46ef-9273-81411cbbb60f", Remarks = @"This will the specific app metadata from the app catalog.", SortOrder = 2)]
18+
[CmdletExample(
19+
Code = @"PS:> Get-PnPApp",
20+
Remarks = @"This will return all available apps from the tenant app catalog. It will list the installed version in the current site.",
21+
SortOrder = 1)]
22+
[CmdletExample(
23+
Code = @"PS:> Get-PnPApp -Scope Site",
24+
Remarks = @"This will return all available apps from the site collection scoped app catalog. It will list the installed version in the current site.",
25+
SortOrder = 2)]
26+
[CmdletExample(
27+
Code = @"PS:> Get-PnPApp -Identity 2646ccc3-6a2b-46ef-9273-81411cbbb60f",
28+
Remarks = @"This willr retrieve the specific app from the app catalog.",
29+
SortOrder = 3)]
1830
public class GetApp : PnPCmdlet
1931
{
2032
[Parameter(Mandatory = false, Position = 0, ValueFromPipeline = true, HelpMessage = "Specifies the Id of an app which is available in the app catalog")]
2133
public AppMetadataPipeBind Identity;
2234

35+
[Parameter(Mandatory = false, HelpMessage = "Defines which app catalog to use. Defaults to Tenant")]
36+
public AppCatalogScope Scope = AppCatalogScope.Tenant;
37+
2338
protected override void ExecuteCmdlet()
2439
{
2540
var manager = new AppManager(ClientContext);
2641

2742
if (MyInvocation.BoundParameters.ContainsKey("Identity"))
2843
{
29-
AppMetadata app = null;
30-
if (Identity.Id != Guid.Empty)
31-
{
32-
app = manager.GetAvailable(Identity.Id);
33-
} else if(!string.IsNullOrEmpty(Identity.Title))
34-
{
35-
app = manager.GetAvailable(Identity.Title);
36-
}
44+
var app = Identity.GetAppMetadata(ClientContext, Scope);
3745
if (app != null)
3846
{
3947
WriteObject(app);
40-
}
41-
else
48+
} else
4249
{
43-
throw new System.Exception("App not found");
50+
throw new Exception("Cannot find app");
4451
}
4552
}
4653
else
4754
{
48-
var apps = manager.GetAvailable();
55+
var apps = manager.GetAvailable(Scope);
4956
WriteObject(apps,true);
5057
}
5158
}

0 commit comments

Comments
 (0)