This repository was archived by the owner on Jan 19, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 660
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2348 from SharePoint/dev
November 2019 Release
- Loading branch information
Showing
57 changed files
with
3,014 additions
and
327 deletions.
There are no files selected for viewing
Binary file not shown.
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
921 changes: 894 additions & 27 deletions
921
Binaries/release/SharePointPnP.Modernization.Framework.xml
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#if !ONPREMISES | ||
using Microsoft.Online.SharePoint.TenantAdministration; | ||
using Microsoft.SharePoint.Client; | ||
using SharePointPnP.PowerShell.CmdletHelpAttributes; | ||
using SharePointPnP.PowerShell.Commands.Base; | ||
using SharePointPnP.PowerShell.Commands.Base.PipeBinds; | ||
using System; | ||
using System.Management.Automation; | ||
using Resources = SharePointPnP.PowerShell.Commands.Properties.Resources; | ||
|
||
namespace SharePointPnP.PowerShell.Commands.Admin | ||
{ | ||
[Cmdlet(VerbsCommon.Get, "PnPHubSiteChild")] | ||
[CmdletHelp(@"Retrieves all sites linked to a specific hub site", | ||
"Retrieves all sites linked to a specific hub site", | ||
Category = CmdletHelpCategory.TenantAdmin, | ||
SupportedPlatform = CmdletSupportedPlatform.Online)] | ||
[CmdletExample(Code = @"PS:> Get-PnPHubChildSite -Identity https://contoso.sharepoint.com/sites/myhubsite", Remarks = "Returns the sites having configured the provided hub site as their hub site", SortOrder = 1)] | ||
public class GetHubSiteChild : PnPAdminCmdlet | ||
{ | ||
[Parameter(ValueFromPipeline = true, Mandatory = true, HelpMessage = "The URL of the hubsite for which to receive the sites refering to it")] | ||
public HubSitePipeBind Identity { get; set; } | ||
|
||
protected override void ExecuteCmdlet() | ||
{ | ||
HubSiteProperties hubSiteProperties; | ||
try | ||
{ | ||
hubSiteProperties = Identity.GetHubSite(Tenant); | ||
ClientContext.Load(hubSiteProperties, h => h.ID); | ||
ClientContext.ExecuteQueryRetry(); | ||
} | ||
catch (ServerException ex) | ||
{ | ||
if (ex.ServerErrorTypeName.Equals("System.IO.FileNotFoundException")) | ||
{ | ||
throw new ArgumentException(Resources.SiteNotFound, nameof(Identity)); | ||
} | ||
|
||
throw ex; | ||
} | ||
|
||
// Get the ID of the hubsite for which we need to find child sites | ||
var hubSiteId = hubSiteProperties.ID; | ||
|
||
WriteObject(Tenant.GetHubSiteChildUrls(hubSiteId), true); | ||
} | ||
} | ||
} | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
using System; | ||
using Microsoft.SharePoint.Client; | ||
using OfficeDevPnP.Core.Framework.Provisioning.Model.Configuration; | ||
|
||
namespace SharePointPnP.PowerShell.Commands.Base.PipeBinds | ||
{ | ||
public sealed class ApplyConfigurationPipeBind | ||
{ | ||
readonly ApplyConfiguration objectValue; | ||
readonly string value; | ||
|
||
public ApplyConfigurationPipeBind(string str) | ||
{ | ||
value = str; | ||
} | ||
|
||
public ApplyConfigurationPipeBind(ApplyConfiguration configuration) | ||
{ | ||
objectValue = configuration; | ||
} | ||
|
||
internal ApplyConfiguration GetConfiguration(string currentFileSystemLocation) | ||
{ | ||
if (objectValue != null) | ||
{ | ||
return objectValue; | ||
} | ||
if (!string.IsNullOrEmpty(value)) | ||
{ | ||
// is it a path? | ||
try | ||
{ | ||
string path = value; | ||
if (!System.IO.Path.IsPathRooted(value)) | ||
{ | ||
path = System.IO.Path.Combine(currentFileSystemLocation, path); | ||
} | ||
if (System.IO.File.Exists(path)) | ||
{ | ||
return ApplyConfiguration.FromString(System.IO.File.ReadAllText(path)); | ||
} | ||
else | ||
{ | ||
return ApplyConfiguration.FromString(value); | ||
} | ||
} | ||
catch | ||
{ | ||
return null; | ||
} | ||
} | ||
return null; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
using System; | ||
using Microsoft.SharePoint.Client; | ||
using OfficeDevPnP.Core.Framework.Provisioning.Model.Configuration; | ||
|
||
namespace SharePointPnP.PowerShell.Commands.Base.PipeBinds | ||
{ | ||
public sealed class ExtractConfigurationPipeBind | ||
{ | ||
readonly ExtractConfiguration objectValue; | ||
readonly string value; | ||
|
||
public ExtractConfigurationPipeBind(string str) | ||
{ | ||
value = str; | ||
} | ||
|
||
public ExtractConfigurationPipeBind(ExtractConfiguration configuration) | ||
{ | ||
objectValue = configuration; | ||
} | ||
|
||
internal ExtractConfiguration GetConfiguration(string currentFileSystemLocation) | ||
{ | ||
if (objectValue != null) | ||
{ | ||
return objectValue; | ||
} | ||
if (!string.IsNullOrEmpty(value)) | ||
{ | ||
// is it a path? | ||
try | ||
{ | ||
string path = value; | ||
if (!System.IO.Path.IsPathRooted(value)) | ||
{ | ||
path = System.IO.Path.Combine(currentFileSystemLocation, path); | ||
} | ||
if (System.IO.File.Exists(path)) | ||
{ | ||
return ExtractConfiguration.FromString(System.IO.File.ReadAllText(path)); | ||
} | ||
else | ||
{ | ||
return ExtractConfiguration.FromString(value); | ||
} | ||
} | ||
catch | ||
{ | ||
return null; | ||
} | ||
} | ||
return null; | ||
} | ||
} | ||
} |
Oops, something went wrong.