From bb2a909db98693ee850ea19d558e1acae60b5028 Mon Sep 17 00:00:00 2001 From: Milan Holemans <11723921+milanholemans@users.noreply.github.com> Date: Sat, 6 Aug 2022 16:12:38 +0200 Subject: [PATCH] Update deprecated graph endpoint --- .../Purview/GetAvailableSensitivityLabel.cs | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/Commands/Purview/GetAvailableSensitivityLabel.cs b/src/Commands/Purview/GetAvailableSensitivityLabel.cs index ac1d73a0a..f1debcd91 100644 --- a/src/Commands/Purview/GetAvailableSensitivityLabel.cs +++ b/src/Commands/Purview/GetAvailableSensitivityLabel.cs @@ -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; @@ -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)))