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

Commit 054072e

Browse files
Merge pull request #1514 from SharePoint/dev
April 2018 Intermediate Release
2 parents dcb5981 + 521f348 commit 054072e

File tree

7 files changed

+67
-43
lines changed

7 files changed

+67
-43
lines changed

CHANGELOG.md

+17-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,23 @@ 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
8+
## [2.26.1805.0] - Unreleased
9+
### Added
10+
11+
### Changed
12+
- Updated Set-PnPTenantSite to handle changing the Site Lock State correctly. You cannot use both -LockState and set other properties at the same time due to possible delays in making the lockstate effective.
13+
14+
### Deprecated
15+
16+
### Contributors
17+
18+
## [2.25.1804.1]
19+
### Changed
20+
- Now using signed core library assembly
21+
- Updated Set-PnPTenantSite to handle changing the Site Lock State correctly. You cannot use both -LockState and set other properties at the same time due to possible delays in making the lockstate effective.
22+
23+
24+
## [2.25.1804.0]
925
### Added
1026
- Added -Tree parameter to Get-PnPNavigationNode which will return a tree representation of the selected navigation structure
1127
- Added -Parent parameter which takes an ID to Add-PnPNavigationNode instead of using the -Header parameter

Commands/Admin/SetTenant.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ namespace SharePointPnP.PowerShell.Commands.Admin
1919
Category = CmdletHelpCategory.TenantAdmin)]
2020
[CmdletExample(
2121
Code = @"PS:> Set-PnPTenantSite -Identity https://contoso.sharepoint.com/sites/team1 -LockState NoAccess
22-
Set-PnPTenant -NoAcessRedirectUrl 'http://www.contoso.com'",
22+
Set-PnPTenant -NoAccessRedirectUrl 'http://www.contoso.com'",
2323
Remarks = @"This example blocks access to https://contoso.sharepoint.com/sites/team1 and redirects traffic to http://www.contoso.com.", SortOrder = 1)]
2424
[CmdletExample(
2525
Code = @"PS:> Set-PnPTenant -ShowEveryoneExceptExternalUsersClaim $false",

Commands/Admin/SetTenantSite.cs

+40-32
Original file line numberDiff line numberDiff line change
@@ -33,37 +33,40 @@ namespace SharePointPnP.PowerShell.Commands
3333
Remarks = @"This will enable script support for the site 'https://contoso.sharepoint.com/sites/sales' if disabled.", SortOrder = 5)]
3434
public class SetTenantSite : PnPAdminCmdlet
3535
{
36+
private const string ParameterSet_LOCKSTATE = "Set Lock State";
37+
private const string ParameterSet_PROPERTIES= "Set Properties";
38+
3639
[Parameter(Mandatory = true, HelpMessage = "Specifies the URL of the site", Position = 0, ValueFromPipeline = true)]
3740
public string Url;
3841

39-
[Parameter(Mandatory = false, HelpMessage = "Specifies the title of the site")]
42+
[Parameter(Mandatory = false, HelpMessage = "Specifies the title of the site", ParameterSetName = ParameterSet_PROPERTIES)]
4043
public string Title;
4144

42-
[Parameter(Mandatory = false, HelpMessage = "Specifies what the sharing capablilites are for the site. Possible values: Disabled, ExternalUserSharingOnly, ExternalUserAndGuestSharing, ExistingExternalUserSharingOnly")]
45+
[Parameter(Mandatory = false, HelpMessage = "Specifies what the sharing capablilites are for the site. Possible values: Disabled, ExternalUserSharingOnly, ExternalUserAndGuestSharing, ExistingExternalUserSharingOnly", ParameterSetName = ParameterSet_PROPERTIES)]
4346
public SharingCapabilities? Sharing = null;
4447

45-
[Parameter(Mandatory = false, HelpMessage = "Specifies the storage quota for this site collection in megabytes. This value must not exceed the company's available quota.")]
48+
[Parameter(Mandatory = false, HelpMessage = "Specifies the storage quota for this site collection in megabytes. This value must not exceed the company's available quota.", ParameterSetName = ParameterSet_PROPERTIES)]
4649
public long? StorageMaximumLevel = null;
4750

48-
[Parameter(Mandatory = false, HelpMessage = "Specifies the warning level for the storage quota in megabytes. This value must not exceed the values set for the StorageMaximumLevel parameter")]
51+
[Parameter(Mandatory = false, HelpMessage = "Specifies the warning level for the storage quota in megabytes. This value must not exceed the values set for the StorageMaximumLevel parameter", ParameterSetName = ParameterSet_PROPERTIES)]
4952
public long? StorageWarningLevel = null;
5053

51-
[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.")]
54+
[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.", ParameterSetName = ParameterSet_PROPERTIES)]
5255
public double? UserCodeMaximumLevel = null;
5356

54-
[Parameter(Mandatory = false, HelpMessage = "Specifies the warning level for the resource quota. This value must not exceed the value set for the UserCodeMaximumLevel parameter")]
57+
[Parameter(Mandatory = false, HelpMessage = "Specifies the warning level for the resource quota. This value must not exceed the value set for the UserCodeMaximumLevel parameter", ParameterSetName = ParameterSet_PROPERTIES)]
5558
public double? UserCodeWarningLevel = null;
5659

57-
[Parameter(Mandatory = false, HelpMessage = "Specifies if the site administrator can upgrade the site collection")]
60+
[Parameter(Mandatory = false, HelpMessage = "Specifies if the site administrator can upgrade the site collection", ParameterSetName = ParameterSet_PROPERTIES)]
5861
public SwitchParameter? AllowSelfServiceUpgrade = null;
5962

60-
[Parameter(Mandatory = false, HelpMessage = "Specifies owner(s) to add as site collection adminstrators. They will be added as additional site collection administrators. Existing administrators will stay. Can be both users and groups.")]
63+
[Parameter(Mandatory = false, HelpMessage = "Specifies owner(s) to add as site collection adminstrators. They will be added as additional site collection administrators. Existing administrators will stay. Can be both users and groups.", ParameterSetName = ParameterSet_PROPERTIES)]
6164
public List<string> Owners;
6265

63-
[Parameter(Mandatory = false, HelpMessage = "Sets the lockstate of a site")]
64-
public SiteLockState LockState;
66+
[Parameter(Mandatory = false, HelpMessage = "Sets the lockstate of a site", ParameterSetName = ParameterSet_LOCKSTATE)]
67+
public SiteLockState? LockState;
6568

66-
[Parameter(Mandatory = false, HelpMessage = "Specifies if a site allows custom script or not. See https://support.office.com/en-us/article/Turn-scripting-capabilities-on-or-off-1f2c515f-5d7e-448a-9fd7-835da935584f for more information.")]
69+
[Parameter(Mandatory = false, HelpMessage = "Specifies if a site allows custom script or not. See https://support.office.com/en-us/article/Turn-scripting-capabilities-on-or-off-1f2c515f-5d7e-448a-9fd7-835da935584f for more information.", ParameterSetName = ParameterSet_PROPERTIES)]
6770
public SwitchParameter NoScriptSite;
6871

6972
[Parameter(Mandatory = false, HelpMessage = "Wait for the operation to complete")]
@@ -72,30 +75,35 @@ protected override void ExecuteCmdlet()
7275
{
7376
Func<TenantOperationMessage, bool> timeoutFunction = TimeoutFunction;
7477

75-
Tenant.SetSiteProperties(Url, title: Title,
76-
sharingCapability: Sharing,
77-
storageMaximumLevel: StorageMaximumLevel,
78-
storageWarningLevel: StorageWarningLevel,
79-
allowSelfServiceUpgrade: AllowSelfServiceUpgrade,
80-
userCodeMaximumLevel: UserCodeMaximumLevel,
81-
userCodeWarningLevel: UserCodeWarningLevel,
82-
noScriptSite: NoScriptSite,
83-
wait: Wait, timeoutFunction: Wait ? timeoutFunction : null
84-
);
85-
86-
if (Owners != null && Owners.Count > 0)
78+
if(LockState.HasValue)
8779
{
88-
var admins = new List<UserEntity>();
89-
foreach (var owner in Owners)
90-
{
91-
var userEntity = new UserEntity { LoginName = owner };
92-
admins.Add(userEntity);
93-
}
94-
Tenant.AddAdministrators(admins, new Uri(Url));
80+
Tenant.SetSiteLockState(Url, LockState.Value, Wait, Wait ? timeoutFunction : null);
81+
WriteWarning("You changed the lockstate of a site. This change is not guaranteed to be effective immediately. Please wait a few minutes for this to take effect.");
9582
}
96-
if (MyInvocation.BoundParameters.ContainsKey("LockState"))
83+
84+
if (!LockState.HasValue)
9785
{
98-
Tenant.SetSiteLockState(Url, LockState, Wait, Wait ? timeoutFunction : null);
86+
Tenant.SetSiteProperties(Url, title: Title,
87+
sharingCapability: Sharing,
88+
storageMaximumLevel: StorageMaximumLevel,
89+
storageWarningLevel: StorageWarningLevel,
90+
allowSelfServiceUpgrade: AllowSelfServiceUpgrade,
91+
userCodeMaximumLevel: UserCodeMaximumLevel,
92+
userCodeWarningLevel: UserCodeWarningLevel,
93+
noScriptSite: NoScriptSite,
94+
wait: Wait, timeoutFunction: Wait ? timeoutFunction : null
95+
);
96+
97+
if (Owners != null && Owners.Count > 0)
98+
{
99+
var admins = new List<UserEntity>();
100+
foreach (var owner in Owners)
101+
{
102+
var userEntity = new UserEntity { LoginName = owner };
103+
admins.Add(userEntity);
104+
}
105+
Tenant.AddAdministrators(admins, new Uri(Url));
106+
}
99107
}
100108
}
101109

Commands/Branding/SetWebTheme.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ namespace SharePointPnP.PowerShell.Commands.Branding
1616
Remarks = @"Sets the theme named ""MyTheme"" to the current web",
1717
SortOrder = 1)]
1818
[CmdletExample(
19-
Code = @"PS:> Get-PnPTenantTheme -Name ""MyTheme"" | Set-PnPTheme",
19+
Code = @"PS:> Get-PnPTenantTheme -Name ""MyTheme"" | Set-PnPWebTheme",
2020
Remarks = @"Sets the theme named ""MyTheme"" to the current web",
2121
SortOrder = 2)]
2222
public class SetWebTheme : PnPWebCmdlet
@@ -54,4 +54,4 @@ protected override void ExecuteCmdlet()
5454
}
5555
}
5656
}
57-
#endif
57+
#endif

Commands/ClientSidePages/SetClientSideWebPart.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ namespace SharePointPnP.PowerShell.Commands.ClientSidePages
1414
DetailedDescription = "Sets specific client side webpart properties. Notice that the title parameter will only set the -internal- title of webpart. The title which is shown in the UI will, if possible, have to be set using the PropertiesJson parameter. Use Get-PnPClientSideComponent to retrieve the instance id and properties of a webpart.",
1515
Category = CmdletHelpCategory.WebParts)]
1616
[CmdletExample(
17-
Code = @"PS:> Set-PnPClientSideWebPart -Page Home -InstanceId a2875399-d6ff-43a0-96da-be6ae5875f82 -PropertiesJson $myproperties",
17+
Code = @"PS:> Set-PnPClientSideWebPart -Page Home -Identity a2875399-d6ff-43a0-96da-be6ae5875f82 -PropertiesJson $myproperties",
1818
Remarks = @"Sets the properties of the client side webpart given in the $myproperties variable.", SortOrder = 1)]
1919
public class SetClientSideWebPart : PnPWebCmdlet
2020
{
@@ -71,4 +71,4 @@ protected override void ExecuteCmdlet()
7171
}
7272
}
7373
}
74-
#endif
74+
#endif

Commands/Principals/GetGroup.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,17 @@
77
namespace SharePointPnP.PowerShell.Commands.Principals
88
{
99
[Cmdlet(VerbsCommon.Get, "PnPGroup",DefaultParameterSetName="All")]
10-
[CmdletHelp("Returns a specific group or all groups.",
10+
[CmdletHelp("Returns a specific SharePoint group or all SharePoint groups in site.",
1111
Category = CmdletHelpCategory.Principals,
1212
OutputType = typeof(List<Group>),
1313
OutputTypeLink = "https://msdn.microsoft.com/en-us/library/microsoft.sharepoint.client.group.aspx")]
1414
[CmdletExample(
1515
Code = @"PS:> Get-PnPGroup",
16-
Remarks = "Returns all groups",
16+
Remarks = "Returns all SharePoint groups in a site",
1717
SortOrder = 1)]
1818
[CmdletExample(
1919
Code = @"PS:> Get-PnPGroup -Identity 'My Site Users'",
20-
Remarks = "This will return the group called 'My Site Users' if available",
20+
Remarks = "This will return the group called 'My Site Users' in if available in the current site",
2121
SortOrder = 2)]
2222
[CmdletExample(
2323
Code = @"PS:> Get-PnPGroup -AssociatedMemberGroup",

Commands/Properties/AssemblyInfo.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,6 @@
4444
// You can specify all the values or you can default the Build and Revision Numbers
4545
// by using the '*' as shown below:
4646
// [assembly: AssemblyVersion("1.0.*")]
47-
[assembly: AssemblyVersion("2.25.1804.0")]
48-
[assembly: AssemblyFileVersion("2.25.1804.0")]
47+
[assembly: AssemblyVersion("2.25.1804.1")]
48+
[assembly: AssemblyFileVersion("2.25.1804.1")]
4949
[assembly: InternalsVisibleTo("SharePointPnP.PowerShell.Tests")]

0 commit comments

Comments
 (0)