Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent type casts for Entra commands' parameters #1148

Open
alexandair opened this issue Oct 10, 2024 · 0 comments
Open

Inconsistent type casts for Entra commands' parameters #1148

alexandair opened this issue Oct 10, 2024 · 0 comments
Labels
enhancement New feature or request P1 ToTriage

Comments

@alexandair
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request P1 ToTriage
Projects
None yet
Development

No branches or pull requests

2 participants