teams picture set [options]
Updates picture of the specified Microsoft Teams team
| Option | Description |
| ----------------------- | ----------------------------------------- |
| -i, --teamId <teamId> | The ID of the team for which to update the picture |
| --imagePath <imagePath> | Path to the image file to set as the team's picture |
PATCH /groups/{id}/photo/$value
Since there is currently a limit of 4MB on the total size of each REST request, this limits the size of the photo you can add to under 4MB.
https://docs.microsoft.com/en-us/graph/api/profilephoto-update?view=graph-rest-1.0&tabs=http
Do you suggest using https://docs.microsoft.com/en-us/graph/api/profilephoto-update?view=graph-rest-1.0 -> PUT /groups/{id}/photo/$value for that command?
Seems like the right fit for the job @thomyg
Feel free to assign me Waldek.
All yours @thomyg!
Need to dig a little deeper here. The graph call from above sets the image of the group immediately but not for the Team or the SharePoint SiteCollection. At least it's the same experience as in the UI which also isn't synced immediately. I ask around what options might be available.
Are you still working on it @thomyg?
Setting as free to pick up due to lack of response
I started looking at this and I see that the functionality is already present in the o365group-set command (using the logoPath option).
Good spot @jhagstrom 馃憤馃徎
We have the ability to create alias commands in the CLI, see https://pnp.github.io/office365-cli/cmd/aad/o365group/o365group-user-add
Would you like to pick this up?
Sure, I can give it a go. :)
Awesome, thanks for your help 馃憤馃徎
Exploring this further reveals that there is a significant overlap between o365group-set and teams-team-set commands. The second could really be an alias for the former since it also includes the logo/image setting). What is missing from a Microsoft Graph perspective are the Teams specific updates (memberSettings, messagingSettings and funSettings) https://docs.microsoft.com/en-us/graph/api/team-update?view=graph-rest-1.0&tabs=http.
But those are covered by three separate get/set commands under Teams, which could be bundled into one command since they all call team/
What do you think?
Comparing both commands, they have different options. If we made team set an alias of o365group set, would be able to retain all options from both commands? If not, then it would introduce a breaking change which I think we should avoid.
If we want to avoid duplicating the code then we could centralize the code responsible for updating the shared portion of teams and groups and reference it in both commands. I wouldn't introduce an update command next to set because they're very similar and would end up confusing users, plus in all other places we use set as the update verb.
Updated OP to use new command template
Hey @jhagstrom are you still working on this?
I am now. Sorry I got waylaid by myself there. Checking my local branch I seem to be close to an implementation that extracts the shared functionality into a service that both teams and groups commands can use. Not quite done yet though.
Great, thanks for the update 馃憤馃徎
@jhagstrom opened a PR #1421 that needs finishing. Since he's unable to finish it himself, we'd welcome some help to get it done. We're almost there
Most helpful comment
I am now. Sorry I got waylaid by myself there. Checking my local branch I seem to be close to an implementation that extracts the shared functionality into a service that both teams and groups commands can use. Not quite done yet though.