Skip to content

Commit

Permalink
Update deprecated graph endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
milanholemans authored and gautamdsheth committed Aug 17, 2022
1 parent ca157b3 commit 8c360a4
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/Commands/Purview/GetAvailableSensitivityLabel.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using PnP.PowerShell.Commands.Attributes;
using PnP.PowerShell.Commands.Base;
using PnP.PowerShell.Commands.Base;
using PnP.PowerShell.Commands.Base.PipeBinds;
using PnP.PowerShell.Commands.Utilities.REST;
using System;
Expand All @@ -26,24 +25,24 @@ protected override void ExecuteCmdlet()
{
var user = User.GetUser(AccessToken);

if(user == null)
if (user == null)
{
WriteWarning("Provided user not found");
return;
}

url = $"/beta/users/{user.UserPrincipalName}/informationProtection/policy/labels";
url = $"/beta/users/{user.UserPrincipalName}/security/informationProtection/sensitivityLabels";
}
else
{
if(Connection.ConnectionMethod == Model.ConnectionMethod.AzureADAppOnly)
if (Connection.ConnectionMethod == Model.ConnectionMethod.AzureADAppOnly)
{
url = "/beta/informationProtection/policy/labels";
url = "/beta/security/informationProtection/sensitivityLabels";
}
else
{
url = "/beta/me/informationProtection/policy/labels";
}
url = "/beta/me/security/informationProtection/sensitivityLabels";
}
}

if (ParameterSpecified(nameof(Identity)))
Expand Down

0 comments on commit 8c360a4

Please sign in to comment.