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

-Members should accept ids #3120

Open
danielniccoli opened this issue Feb 12, 2025 · 2 comments
Open

-Members should accept ids #3120

danielniccoli opened this issue Feb 12, 2025 · 2 comments

Comments

@danielniccoli
Copy link

Is your feature request related to a problem? Please describe the problem.

New-MgGroup … -Members 70b5931c-98e4-4077-8e96-81b7a5b057ff,189d20f0-ab4e-4378-a728-3ea0b6f7b1a0

Returns

Error: "Cannot convert the "d7df1f72-6d53-4667-ba05-90a979412bb8" value of type "System.String" to type "Microsoft.Graph.PowerShell.Models.IMicrosoftGraphDirectoryObject"

Describe the solution you'd like.

I'd like the SDK to handle ids natively.

Additional context?

No response

@danielniccoli danielniccoli added status:waiting-for-triage An issue that is yet to be reviewed or assigned type:feature New experience request labels Feb 12, 2025
@timayabi2020
Copy link
Contributor

@danielniccoli thank you for raising this issue. Based on the error, the type -Members parameter expects is of Microsoft.Graph.PowerShell.Models.IMicrosoftGraphDirectoryObject. Please refer to the documentation here on how to use that particular parameter.

Image

@timayabi2020 timayabi2020 added Question: SDK status:waiting-for-author-feedback Issue that we've responded but needs author feedback to close and removed status:waiting-for-triage An issue that is yet to be reviewed or assigned type:feature New experience request labels Feb 12, 2025
@danielniccoli
Copy link
Author

danielniccoli commented Feb 12, 2025

I know it expects Microsoft.Graph.PowerShell.Models.IMicrosoftGraphDirectoryObject and that is exactly why I created this feature request. Using a complex object type, when IDs suffice is completely unnecessary. The SDK should make your life easier, not harder! And frankly, using plain HTTPS requests is much simpler at this point.

And the "documentation" you linked is not helpful.

Supports the List members, Add member, and Remove member operations. Nullable. Supports $expand including nested $select. For example, /groups$filter=startsWith(displayName,'Role')&$select=id,displayName&$expand=members($select=id,userPrincipalName,displayName).

What does that even mean?

To construct, see NOTES section for MEMBERS properties and create a hash table.

There is no section "MEMBERS" in the notes.

@microsoft-github-policy-service microsoft-github-policy-service bot added Needs: Attention 👋 and removed status:waiting-for-author-feedback Issue that we've responded but needs author feedback to close labels Feb 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants