1- using System . Management . Automation ;
21using PnP . PowerShell . Commands . Attributes ;
32using PnP . PowerShell . Commands . Base ;
43using PnP . PowerShell . Commands . Base . PipeBinds ;
54using PnP . PowerShell . Commands . Enums ;
65using PnP . PowerShell . Commands . Model . AzureAD ;
76using PnP . PowerShell . Commands . Utilities ;
7+ using System . Management . Automation ;
88
99namespace PnP . PowerShell . Commands . Apps
1010{
1111 [ Cmdlet ( VerbsCommon . Add , "PnPAzureADServicePrincipalAppRole" ) ]
12- [ RequiredApiApplicationPermissions ( "graph/AppRoleAssignment.ReadWrite.All" , "Application.Read.All" ) ]
12+ [ RequiredApiDelegatedOrApplicationPermissions ( "graph/AppRoleAssignment.ReadWrite.All" ) ]
13+ [ RequiredApiDelegatedOrApplicationPermissions ( "graph/Application.Read.All" ) ]
14+ [ RequiredApiDelegatedOrApplicationPermissions ( "graph/Application.ReadWrite.All" ) ]
1315 [ Alias ( "Add-PnPEntraIDServicePrincipalAppRole" ) ]
1416 public class AddAzureADServicePrincipalAppRole : PnPGraphCmdlet
1517 {
@@ -30,13 +32,13 @@ public class AddAzureADServicePrincipalAppRole : PnPGraphCmdlet
3032 public ServicePrincipalPipeBind Resource ;
3133
3234 [ Parameter ( Mandatory = true , ParameterSetName = ParameterSet_BYBUILTINTYPE ) ]
33- public ServicePrincipalBuiltInType BuiltInType ;
35+ public ServicePrincipalBuiltInType BuiltInType ;
3436
3537 protected override void ExecuteCmdlet ( )
3638 {
3739 var principal = Principal . GetServicePrincipal ( this , Connection , AccessToken ) ;
3840
39- if ( principal == null )
41+ if ( principal == null )
4042 {
4143 throw new PSArgumentException ( "Service principal not found" , nameof ( Principal ) ) ;
4244 }
@@ -59,8 +61,8 @@ protected override void ExecuteCmdlet()
5961 {
6062 appRole = AppRole . AppRole ;
6163 }
62-
63- if ( appRole == null )
64+
65+ if ( appRole == null )
6466 {
6567 throw new PSArgumentException ( "AppRole not found" , nameof ( AppRole ) ) ;
6668 }
0 commit comments