pnp / cli-microsoft365

Manage Microsoft 365 and SharePoint Framework projects on any platform
https://aka.ms/cli-m365
MIT License
921 stars 325 forks source link

New command: viva engage community set #6279

Open MartinM85 opened 2 months ago

MartinM85 commented 2 months ago

Usage

m365 viva engage community set [options]

Description

Updates an existing Viva Engage community

Options

Option Description
-i, --id [id] The id of the community. Specify either id, displayName or entraGroupId, but not multiple.
-d, --displayName [displayName] The name of the community. Specify either id, displayName or entraGroupId, but not multiple.
--entraGroupId [entraGroupId] The id of the Microsoft Entra group associated with the community. Specify either id, displayName or entraGroupId, but not multiple.
--newDisplayName [newDisplayName] New name for the community. The maximum length is 255 characters.
--description [description] The description of the community. The maximum length is 1024 characters.
--privacy [privacy] Defines the privacy level of the community. The possible values are: public, and private.

Examples

Update info about the community specified by the community id

m365 viva engage community set --id eyJfdHlwZSI6Ikdyb3VwIiwiaWQiOiI0NzY5MTM1ODIwOSJ9 --newDisplayName 'Developers' --description 'Community for all devs' --privacy public

Update info about the community specified by name

m365 viva engage community set --displayName 'Developrs' --newDisplayName 'Developers'

Update info about the community specified by the Microsoft Entra group id

m365 viva engage community set --entraGroupId 0bed8b86-5026-4a93-ac7d-56750cc099f1 --newDisplayName 'Developers' --description 'Community for all devs' --privacy public

Default properties

No response

Additional Info

API https://learn.microsoft.com/en-us/graph/api/community-update?view=graph-rest-1.0&tabs=http

milanholemans commented 2 months ago

Hi @MartinM85, to improve friendliness, I suggest that we use 2 options displayName and newDisplayName. Same question here. Do you want to work on it, or should we open it up?

MartinM85 commented 2 months ago

@milanholemans Spec updated. I can take it

Jwaegebaert commented 2 months ago

Thinking a bit more about this command, how about we add an option for --groupId? It might be more informative to update a community using its groupId rather than communityId. What do you think, @milanholemans, @MartinM85?

milanholemans commented 2 months ago

In that case, shouldn't people just use the entra m365group commands? If you change the description, display name or privacy there, it should sync to Viva Engage as well.

Jwaegebaert commented 2 months ago

That’s a good point, but I’m not sure everyone would know that. If you’re working within the viva engage command space, they might not think to check Entra commands. It’s a bit of an edge case, so I’m not sure if it’s worth the effort 😄.

milanholemans commented 2 months ago

We should also strive for consistency. This means that when we add this option to one command, we should add it to all viva engage commands. I'm not sure if this is feasible, for the viva engage community get command for example, we are unable to use the Viva Engage APIs when we only have the group ID.

Jwaegebaert commented 2 months ago

It would be a bit of a workaround to get it working with just the groupId, but not impossible. If we have a way to do it, might be useful to add the method to a central util for the community commands since I also specced out the user commands with groupId. Alternatively, we could just remove them from the spec and we can stick with communityId and communityName. I'm good with either.

MartinM85 commented 2 months ago

I would start with the version without the groupId.

milanholemans commented 2 months ago

@Jwaegebaert maybe we should agree on whether we user groupId or not before reviewing:

I can live with both stances to include it, or not. But IMO if we include it, we should name it entraGroupId to make it a bit more clear. What do you think @pnp/cli-for-microsoft-365-maintainers?

Adam-it commented 2 months ago

I also don't have a strong opinion about the group option as long as it is somehow clear, either in option name like @milanholemans mentioned to use entraGroupId, or in option description. Other than that I think we may add such an option if possible 👍

Jwaegebaert commented 2 months ago

Would entraGroupId make it clearer? The community groups are strictly M365 groups, and while M365 is part of all types of Entra Groups, using entraGroupId wouldn’t add much clarity. The description already specifies that it only accepts M365 groups.

MartinM85 commented 2 months ago

Ok, spec updated.