This repository has been archived by the owner on Jan 19, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 661
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 #2957 from pnp/dev
October 2020 Release
- Loading branch information
Showing
37 changed files
with
925 additions
and
100 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file modified
BIN
+16 Bytes
(100%)
Binaries/release/SharePointPnP.Modernization.Framework.dll
Binary file not shown.
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
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,37 @@ | ||
using Microsoft.Identity.Client; | ||
using OfficeDevPnP.Core; | ||
using PnP.PowerShell.CmdletHelpAttributes; | ||
using PnP.PowerShell.Commands.Model; | ||
using System; | ||
using System.Management.Automation; | ||
|
||
namespace PnP.PowerShell.Commands.Base | ||
{ | ||
[Cmdlet(VerbsLifecycle.Register, "PnPManagementShellAccess")] | ||
[CmdletHelp("Registers the multi-tenant app PnP Management Shell for delegate access to the required environments", | ||
Category = CmdletHelpCategory.TenantAdmin)] | ||
[CmdletExample( | ||
Code = "PS:> Register-PnPManagementShellAccess -SiteUrl https://yourtenant.sharepoint.com", | ||
Remarks = "Will prompt you to authenticate and if needed will ask you to provide consent to specific required rights.", | ||
SortOrder = 1)] | ||
public class RegisterPnPManagementShellAccess : PSCmdlet | ||
{ | ||
[Parameter(Mandatory = false)] | ||
public AzureEnvironment AzureEnvironment = AzureEnvironment.Production; | ||
|
||
[Parameter(Mandatory = true)] | ||
public string SiteUrl; | ||
protected override void ProcessRecord() | ||
{ | ||
var endPoint = GenericToken.GetAzureADLoginEndPoint(AzureEnvironment); | ||
var uri = new Uri(SiteUrl); | ||
var scopes = new[] { $"{uri.Scheme}://{uri.Authority}//.default" }; | ||
|
||
var application = PublicClientApplicationBuilder.Create(PnPConnection.PnPManagementShellClientId).WithAuthority($"{endPoint}/organizations/").WithRedirectUri("https://login.microsoftonline.com/common/oauth2/nativeclient").Build(); | ||
|
||
var result = application.AcquireTokenInteractive(scopes).ExecuteAsync().GetAwaiter().GetResult(); | ||
result = application.AcquireTokenInteractive(new[] { "https://graph.microsoft.com/.default" }).ExecuteAsync().GetAwaiter().GetResult(); | ||
|
||
} | ||
} | ||
} |
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
Oops, something went wrong.