@@ -51,7 +51,7 @@ PowerShell:
5151
5252``` powershell
5353$teamOwner=mgc users get --user-id "{TEAM_OWNER_UPN}"
54- mgc teams item members create --team-id $InternsTeam.id --body '{"additionalProperties": {
54+ mgc teams members create --team-id $InternsTeam.id --body '{"additionalProperties": {
5555 "@odata.type": "#microsoft.graph.aadUserConversationMember",
5656 "[email protected] ": "https://graph.microsoft.com/v1.0/users/" + $teamOwner.id 5757 }, "roles": ["owner"]}'
@@ -60,7 +60,7 @@ mgc teams item members create --team-id $InternsTeam.id --body '{"additionalProp
6060CMD:
6161
6262``` shell
63- mgc teams
item members create --team-id %InternsTeamId% --body
" {" " additionalProperties" " : {" " @odata.type" " : " " #microsoft.graph.aadUserConversationMember" " ," " [email protected] " " : " " https://graph.microsoft.com/v1.0/users/%UserId%" " }, " " roles" " : [" " owner" " ]}" 63+ mgc teams members create --team-id %InternsTeamId% --body
" {" " additionalProperties" " : {" " @odata.type" " : " " #microsoft.graph.aadUserConversationMember" " ," " [email protected] " " : " " https://graph.microsoft.com/v1.0/users/%UserId%" " }, " " roles" " : [" " owner" " ]}" 6464```
6565
6666Bash:
6969teamOwnerId=$( mgc users get --user-id " {TEAM_OWNER_UPN}" | grep -o ' "id": "[^"]*' | grep -o ' [^"]*$' )
7070teamId=$( echo $InternsTeam | grep -o ' "id": "[^"]*' | grep -o ' [^"]*$' )
7171
72- mgc teams item members create --team-id $teamId --body ' {"additionalProperties": {
72+ mgc teams members create --team-id $teamId --body ' {"additionalProperties": {
7373 "@odata.type": "#microsoft.graph.aadUserConversationMember",
7474 "[email protected] ": "https://graph.microsoft.com/v1.0/users/" + $teamOwnerId 7575 }, "roles": ["owner"]}'
@@ -80,23 +80,23 @@ mgc teams item members create --team-id $teamId --body '{"additionalProperties":
8080PowerShell:
8181
8282``` powershell
83- $PrimaryChannel = mgc teams item primary-channel get --team-id $InternsTeam.id
83+ $PrimaryChannel = mgc teams primary-channel get --team-id $InternsTeam.id
8484$body = ConvertTo-Json '{"body": {"content": "Welcome to Teams!"}}'
85- mgc teams item channels item messages create --team-id $InternsTeam.id --channel-id $PrimaryChannel.id --body $body
85+ mgc teams channels messages create --team-id $InternsTeam.id --channel-id $PrimaryChannel.id --body $body
8686```
8787
8888CMD:
8989
9090``` shell
91- mgc teams item primary-channel get --team-id %TeamId%
92- mgc teams item channels item messages create --team-id %TeamId% --channel-id %PrimaryChannelId% --body " {" " body" " : {" " content" " : " " Welcome to Teams!" " }}"
91+ mgc teams primary-channel get --team-id %TeamId%
92+ mgc teams channels messages create --team-id %TeamId% --channel-id %PrimaryChannelId% --body " {" " body" " : {" " content" " : " " Welcome to Teams!" " }}"
9393```
9494
9595Bash:
9696
9797``` sh
98- PrimaryChannelId=$( mgc teams item primary-channel get --team-id $teamId | grep -o ' "id": "[^"]*' | grep -o ' [^"]*$' )
99- mgc teams item channels item messages create --team-id $teamId --channel-id $PrimaryChannelId --body ' {"body": {"content": "Welcome to Teams!"}}'
98+ PrimaryChannelId=$( mgc teams primary-channel get --team-id $teamId | grep -o ' "id": "[^"]*' | grep -o ' [^"]*$' )
99+ mgc teams channels messages create --team-id $teamId --channel-id $PrimaryChannelId --body ' {"body": {"content": "Welcome to Teams!"}}'
100100```
101101
102102### Delete team
@@ -130,33 +130,33 @@ mgc chats list
130130#### Get Messages from Chat
131131
132132``` sh
133- mgc chats item messages list --chat-id < ChatId>
133+ mgc chats messages list --chat-id < ChatId>
134134```
135135
136136#### Send a message in that 1:1 chat
137137
138138``` sh
139- mgc chats item messages create --chat-id < ChatId> --body ' {"body": {"content": "Hi from CLI!"}}'
139+ mgc chats messages create --chat-id < ChatId> --body ' {"body": {"content": "Hi from CLI!"}}'
140140```
141141
142142#### Mention a user in a channel message
143143
144144PowerShell:
145145
146146``` powershell
147- $user = mgc users item get --user-id <UserId> --select "id, displayName, userIdentityType"
147+ $user = mgc users get --user-id <UserId> --select "id, displayName, userIdentityType"
148148$body = ConvertTo-Json '{"body": {"contentType": "html", "content": "Welcome to the channel <at id=\'0\'>${user.displayName}</at>!"}, "mentions": [{"id": 0, "mentionText": "${user.displayName}", "mentioned": {"user": {"id": "${user.id}", "displayName": "${user.displayName}", "userIdentityType": "${user.userIdentityType}"}}}]}'
149- mgc teams item channels item messages create --team-id <TeamId> --channel-id $PrimaryChannel.id \
149+ mgc teams channels messages create --team-id <TeamId> --channel-id $PrimaryChannel.id \
150150 --body $body
151151```
152152
153153Bash:
154154
155155``` sh
156- user=$( mgc users item get --user-id < UserId> --select " id, displayName, userIdentityType" )
156+ user=$( mgc users get --user-id < UserId> --select " id, displayName, userIdentityType" )
157157userId=$( echo $user | grep -o ' "id": "[^"]*' | grep -o ' [^"]*$' )
158158userDisplayName=$( echo $user | grep -o ' "displayName": "[^"]*' | grep -o ' [^"]*$' )
159159userIdentityType=$( echo $user | grep -o ' "userIdentityType": "[^"]*' | grep -o ' [^"]*$' )
160- mgc teams item channels item messages create --team-id < TeamId> --channel-id $PrimaryChannelId \
160+ mgc teams channels messages create --team-id < TeamId> --channel-id $PrimaryChannelId \
161161 --body ' {"body": {"contentType": "html", "content": "Welcome to the channel <at id=\' 0\' > ${userDisplayName} < /at> ! " }, " mentions" : [{" id" : 0, " mentionText" : " ${userDisplayName} " , " mentioned" : {" user" : {" id" : " ${userId} " , " displayName" : " ${userDisplayName} " , " userIdentityType" : " ${userIdentityType} " }}}]}'
162162` ` `
0 commit comments