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 #2099 from SharePoint/dev
Browse files Browse the repository at this point in the history
May 2019 Intermediate Release 3
  • Loading branch information
erwinvanhunen authored May 22, 2019
2 parents 1854f9d + d814c32 commit c55dc05
Show file tree
Hide file tree
Showing 6 changed files with 79 additions and 10 deletions.
Binary file modified Binaries/SharePointPnP.Modernization.Framework.dll
Binary file not shown.
Binary file modified Binaries/release/SharePointPnP.Modernization.Framework.dll
Binary file not shown.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ 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.9.1905.3 - May 2019 Intermediate Release 3]

### Changed
- Updatd core provisioning to handle token issue during extraction and reintroduced content type fieldlink reordering in the engine.

## [3.9.1905.2 - May 2019 Intermediate Release 2]

### Changed
Expand Down
4 changes: 2 additions & 2 deletions Commands/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,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("3.9.1905.2")]
[assembly: AssemblyFileVersion("3.9.1905.2")]
[assembly: AssemblyVersion("3.9.1905.3")]
[assembly: AssemblyFileVersion("3.9.1905.3")]
[assembly: InternalsVisibleTo("SharePointPnP.PowerShell.Tests")]
78 changes: 71 additions & 7 deletions Commands/Provisioning/Tenant/ApplyTenantTemplate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
using System.IO;
using System.Linq;
using System.Management.Automation;
using System.Threading.Tasks;

namespace SharePointPnP.PowerShell.Commands.Provisioning.Tenant
{
Expand Down Expand Up @@ -256,22 +257,85 @@ protected override void ExecuteCmdlet()
}
}
}
if (!string.IsNullOrEmpty(SequenceId))
#if !ONPREMISES
using (var provisioningContext = new PnPProvisioningContext((resource, scope) =>
{
Tenant.ApplyProvisionHierarchy(hierarchyToApply, SequenceId, applyingInformation);
}
else
// Get Azure AD Token
if (AccessToken != null)
{
// Authenticated using -Graph or using another way to retrieve the accesstoken with Connect-PnPOnline
return Task.FromResult(AccessToken);
}
else if (SPOnlineConnection.CurrentConnection.PSCredential != null)
{
// Using normal credentials
return Task.FromResult(TokenHandler.AcquireToken(resource, null));
}
else
{
// No token...
return null;
}
}))
{
foreach (var sequence in hierarchyToApply.Sequences)
#endif
if (!string.IsNullOrEmpty(SequenceId))
{
Tenant.ApplyProvisionHierarchy(hierarchyToApply, sequence.ID, applyingInformation);
Tenant.ApplyProvisionHierarchy(hierarchyToApply, SequenceId, applyingInformation);
}
else
{
if (hierarchyToApply.Sequences.Count > 0)
{
foreach (var sequence in hierarchyToApply.Sequences)
{
Tenant.ApplyProvisionHierarchy(hierarchyToApply, sequence.ID, applyingInformation);
}
}
else
{
Tenant.ApplyProvisionHierarchy(hierarchyToApply, null, applyingInformation);
}
}
#if !ONPREMISES
}

#endif
WriteObject(sitesProvisioned, true);

}

private string AccessToken
{
get
{
if (SPOnlineConnection.AuthenticationResult != null)
{
if (SPOnlineConnection.AuthenticationResult.ExpiresOn < DateTimeOffset.Now)
{
WriteWarning(Properties.Resources.MicrosoftGraphOAuthAccessTokenExpired);
SPOnlineConnection.AuthenticationResult = null;
return null;
}
else
{
#if !NETSTANDARD2_0
return (SPOnlineConnection.AuthenticationResult.Token);
#else
return SPOnlineConnection.AuthenticationResult.AccessToken;
#endif
}
}
else if (SPOnlineConnection.CurrentConnection?.AccessToken != null)
{
return SPOnlineConnection.CurrentConnection.AccessToken;
}
else
{
return null;
}
}
}


private ProvisioningHierarchy GetHierarchy()
{
Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.9.1905.2
3.9.1905.3

0 comments on commit c55dc05

Please sign in to comment.