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 #1514 from SharePoint/dev
Browse files Browse the repository at this point in the history
April 2018 Intermediate Release
  • Loading branch information
erwinvanhunen committed Apr 10, 2018
2 parents dcb5981 + 521f348 commit 054072e
Show file tree
Hide file tree
Showing 7 changed files with 67 additions and 43 deletions.
18 changes: 17 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,23 @@ 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/).

## [2.25.1804.0] - Unreleased
## [2.26.1805.0] - Unreleased
### Added

### Changed
- 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.

### Deprecated

### Contributors

## [2.25.1804.1]
### Changed
- Now using signed core library assembly
- 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.


## [2.25.1804.0]
### Added
- Added -Tree parameter to Get-PnPNavigationNode which will return a tree representation of the selected navigation structure
- Added -Parent parameter which takes an ID to Add-PnPNavigationNode instead of using the -Header parameter
Expand Down
2 changes: 1 addition & 1 deletion Commands/Admin/SetTenant.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ namespace SharePointPnP.PowerShell.Commands.Admin
Category = CmdletHelpCategory.TenantAdmin)]
[CmdletExample(
Code = @"PS:> Set-PnPTenantSite -Identity https://contoso.sharepoint.com/sites/team1 -LockState NoAccess
Set-PnPTenant -NoAcessRedirectUrl 'http://www.contoso.com'",
Set-PnPTenant -NoAccessRedirectUrl 'http://www.contoso.com'",
Remarks = @"This example blocks access to https://contoso.sharepoint.com/sites/team1 and redirects traffic to http://www.contoso.com.", SortOrder = 1)]
[CmdletExample(
Code = @"PS:> Set-PnPTenant -ShowEveryoneExceptExternalUsersClaim $false",
Expand Down
72 changes: 40 additions & 32 deletions Commands/Admin/SetTenantSite.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,37 +33,40 @@ namespace SharePointPnP.PowerShell.Commands
Remarks = @"This will enable script support for the site 'https://contoso.sharepoint.com/sites/sales' if disabled.", SortOrder = 5)]
public class SetTenantSite : PnPAdminCmdlet
{
private const string ParameterSet_LOCKSTATE = "Set Lock State";
private const string ParameterSet_PROPERTIES= "Set Properties";

[Parameter(Mandatory = true, HelpMessage = "Specifies the URL of the site", Position = 0, ValueFromPipeline = true)]
public string Url;

[Parameter(Mandatory = false, HelpMessage = "Specifies the title of the site")]
[Parameter(Mandatory = false, HelpMessage = "Specifies the title of the site", ParameterSetName = ParameterSet_PROPERTIES)]
public string Title;

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

[Parameter(Mandatory = false, HelpMessage = "Specifies the storage quota for this site collection in megabytes. This value must not exceed the company's available quota.")]
[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)]
public long? StorageMaximumLevel = null;

[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")]
[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)]
public long? StorageWarningLevel = null;

[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.")]
[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)]
public double? UserCodeMaximumLevel = null;

[Parameter(Mandatory = false, HelpMessage = "Specifies the warning level for the resource quota. This value must not exceed the value set for the UserCodeMaximumLevel parameter")]
[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)]
public double? UserCodeWarningLevel = null;

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

[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.")]
[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)]
public List<string> Owners;

[Parameter(Mandatory = false, HelpMessage = "Sets the lockstate of a site")]
public SiteLockState LockState;
[Parameter(Mandatory = false, HelpMessage = "Sets the lockstate of a site", ParameterSetName = ParameterSet_LOCKSTATE)]
public SiteLockState? LockState;

[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.")]
[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)]
public SwitchParameter NoScriptSite;

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

Tenant.SetSiteProperties(Url, title: Title,
sharingCapability: Sharing,
storageMaximumLevel: StorageMaximumLevel,
storageWarningLevel: StorageWarningLevel,
allowSelfServiceUpgrade: AllowSelfServiceUpgrade,
userCodeMaximumLevel: UserCodeMaximumLevel,
userCodeWarningLevel: UserCodeWarningLevel,
noScriptSite: NoScriptSite,
wait: Wait, timeoutFunction: Wait ? timeoutFunction : null
);

if (Owners != null && Owners.Count > 0)
if(LockState.HasValue)
{
var admins = new List<UserEntity>();
foreach (var owner in Owners)
{
var userEntity = new UserEntity { LoginName = owner };
admins.Add(userEntity);
}
Tenant.AddAdministrators(admins, new Uri(Url));
Tenant.SetSiteLockState(Url, LockState.Value, Wait, Wait ? timeoutFunction : null);
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.");
}
if (MyInvocation.BoundParameters.ContainsKey("LockState"))

if (!LockState.HasValue)
{
Tenant.SetSiteLockState(Url, LockState, Wait, Wait ? timeoutFunction : null);
Tenant.SetSiteProperties(Url, title: Title,
sharingCapability: Sharing,
storageMaximumLevel: StorageMaximumLevel,
storageWarningLevel: StorageWarningLevel,
allowSelfServiceUpgrade: AllowSelfServiceUpgrade,
userCodeMaximumLevel: UserCodeMaximumLevel,
userCodeWarningLevel: UserCodeWarningLevel,
noScriptSite: NoScriptSite,
wait: Wait, timeoutFunction: Wait ? timeoutFunction : null
);

if (Owners != null && Owners.Count > 0)
{
var admins = new List<UserEntity>();
foreach (var owner in Owners)
{
var userEntity = new UserEntity { LoginName = owner };
admins.Add(userEntity);
}
Tenant.AddAdministrators(admins, new Uri(Url));
}
}
}

Expand Down
4 changes: 2 additions & 2 deletions Commands/Branding/SetWebTheme.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ namespace SharePointPnP.PowerShell.Commands.Branding
Remarks = @"Sets the theme named ""MyTheme"" to the current web",
SortOrder = 1)]
[CmdletExample(
Code = @"PS:> Get-PnPTenantTheme -Name ""MyTheme"" | Set-PnPTheme",
Code = @"PS:> Get-PnPTenantTheme -Name ""MyTheme"" | Set-PnPWebTheme",
Remarks = @"Sets the theme named ""MyTheme"" to the current web",
SortOrder = 2)]
public class SetWebTheme : PnPWebCmdlet
Expand Down Expand Up @@ -54,4 +54,4 @@ protected override void ExecuteCmdlet()
}
}
}
#endif
#endif
4 changes: 2 additions & 2 deletions Commands/ClientSidePages/SetClientSideWebPart.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace SharePointPnP.PowerShell.Commands.ClientSidePages
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.",
Category = CmdletHelpCategory.WebParts)]
[CmdletExample(
Code = @"PS:> Set-PnPClientSideWebPart -Page Home -InstanceId a2875399-d6ff-43a0-96da-be6ae5875f82 -PropertiesJson $myproperties",
Code = @"PS:> Set-PnPClientSideWebPart -Page Home -Identity a2875399-d6ff-43a0-96da-be6ae5875f82 -PropertiesJson $myproperties",
Remarks = @"Sets the properties of the client side webpart given in the $myproperties variable.", SortOrder = 1)]
public class SetClientSideWebPart : PnPWebCmdlet
{
Expand Down Expand Up @@ -71,4 +71,4 @@ protected override void ExecuteCmdlet()
}
}
}
#endif
#endif
6 changes: 3 additions & 3 deletions Commands/Principals/GetGroup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@
namespace SharePointPnP.PowerShell.Commands.Principals
{
[Cmdlet(VerbsCommon.Get, "PnPGroup",DefaultParameterSetName="All")]
[CmdletHelp("Returns a specific group or all groups.",
[CmdletHelp("Returns a specific SharePoint group or all SharePoint groups in site.",
Category = CmdletHelpCategory.Principals,
OutputType = typeof(List<Group>),
OutputTypeLink = "https://msdn.microsoft.com/en-us/library/microsoft.sharepoint.client.group.aspx")]
[CmdletExample(
Code = @"PS:> Get-PnPGroup",
Remarks = "Returns all groups",
Remarks = "Returns all SharePoint groups in a site",
SortOrder = 1)]
[CmdletExample(
Code = @"PS:> Get-PnPGroup -Identity 'My Site Users'",
Remarks = "This will return the group called 'My Site Users' if available",
Remarks = "This will return the group called 'My Site Users' in if available in the current site",
SortOrder = 2)]
[CmdletExample(
Code = @"PS:> Get-PnPGroup -AssociatedMemberGroup",
Expand Down
4 changes: 2 additions & 2 deletions Commands/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,6 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.25.1804.0")]
[assembly: AssemblyFileVersion("2.25.1804.0")]
[assembly: AssemblyVersion("2.25.1804.1")]
[assembly: AssemblyFileVersion("2.25.1804.1")]
[assembly: InternalsVisibleTo("SharePointPnP.PowerShell.Tests")]

0 comments on commit 054072e

Please sign in to comment.