entra-powershell icon indicating copy to clipboard operation
entra-powershell copied to clipboard

Inconsistent type casts for Entra commands' parameters

Open alexandair opened this issue 1 year ago • 0 comments

This is a partial list of Set-EntraServicePrincipal parameters:


Parameter                 Aliases  Type
---------                 -------  ----
AlternativeNames                   System.Collections.Generic.List`1[System.String]
ReplyUrls                          System.Collections.Generic.List`1[System.String]
AppRoleAssignmentRequired          System.Nullable`1[System.Boolean]
KeyCredentials                     System.Collections.Generic.List`1[Microsoft.Open.AzureAD.Model.KeyCredential]
ServicePrincipalNames              System.Collections.Generic.List`1[System.String]
Tags                               System.Collections.Generic.List`1[System.String]
PasswordCredentials                 System.Collections.Generic.List`1[Microsoft.Open.AzureAD.Model.PasswordCredential]

Let's compare it to Update-MgServicePrincipal:

Parameter                              Aliases Type
---------                              ------- ----
AlternativeNames                               System.String[]
ReplyUrls                                      System.String[]
AppRoleAssignmentRequired                      System.Management.Automation.SwitchParameter
KeyCredentials                                 Microsoft.Graph.PowerShell.Models.IMicrosoftGraphKeyCredential[]
ServicePrincipalNames                          System.String[]
Tags                                           System.String[]
PasswordCredentials                            Microsoft.Graph.PowerShell.Models.IMicrosoftGraphPasswordCredential[]
System.Collections.Generic.List`1[System.String] instead of System.String[]

System.Nullable`1[System.Boolean] instead of System.Management.Automation.SwitchParameter

System.Collections.Generic.List`1[Microsoft.Open.AzureAD.Model.KeyCredential] instead of Microsoft.Graph.PowerShell.Models.IMicrosoftGraphKeyCredential[]

System.Collections.Generic.List`1[Microsoft.Open.AzureAD.Model.PasswordCredential] instead of Microsoft.Graph.PowerShell.Models.IMicrosoftGraphPasswordCredential[]

Unnecessary generic lists, Boolean instead of switch parameters, AzureAD-based types instead of Microsoft Graph-based ones...

This applies to almost all Entra PowerShell commands. -All parameter is correctly changed to be a switch parameter, but the changes stopped there.

alexandair avatar Oct 10 '24 21:10 alexandair