You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
brock chapin (@bchap1n) As part of #87, we will be introducing an AdditionalProperties bag that will allow customers to pass extra properties to the request body.
Peter Ombwa (@peombwa) I think we need to add this "additionalProperties" to every entity, regardless of whether OpenType is true or not. Also, in the other SDKs we call it "additionalData" not "additionalProperties". Let's discuss further.
Add a common -PropertyValues parameter of type IDictionary.
Make the use of that parameter possible without having to muck around with JSON or the -BodyParameter. i.e. leave -BodyParameter for the most advanced cases where the cmdlet parameters don't work for you, and use the explicitly defined parameters (e.g. -DisplayName, -Description) combined with the flexible -PropertyValues parameter (which is the property bag) to build the request body that will be sent to Graph.
Rename -BodyParameter as -RequestBody, and give it two aliases: BodyParameter and Body. RequestBody is a more accurate and descriptive name, and -Body is a parameter on Invoke-WebRequest and Invoke-RestMethod, so there is familiarity and ease of discovery. The "Parameter" portion of -BodyParameter seems irrelevant given that it is a PowerShell parameter.
Eliminate the need for unnecessarily complex syntax when associating properties with existing entities. i.e. Instead of "template@odata.bind" = "https://graph.microsoft.com/beta/teamsTemplates('standard')", which is a JSON way of indicating that you want to apply a built-in template to a team, simply use -Template $template or -PropertyValues @{Template = $template}, and handle the conversion to JSON internally.
With this in place, assuming I already did something like this:
# Note: This does not work at the moment$standardTemplate=Get-MgTeamTemplate-Name Standard
These would all work. The first three would simply build the JSON request body that you are sending to Graph to do the work in the last one, rather than have you craft it yourself.
Also, the idea of "additionalProperties" or "additionalData" seems unnecessary here, especially given that the Graph endpoint doesn't need or use the extra nesting of properties when it is invoked like this:
Could you just fix the -Template parameter rather than adding a new feature AdditionalProperties? The property is already explicit. If you do however require Template in AdditionalProperties, please remove the -Template parameter.
I know this is an old post but what about adding additional owners? You know, automation and stuff.
It just seems that we are adding graph structure rather than doing this using cmdlet parameters and having the module to the JSON transform
Activity
peombwa commentedon Apr 1, 2020
brock chapin (@bchap1n) As part of #87, we will be introducing an
AdditionalPropertiesbag that will allow customers to pass extra properties to the request body.In this case, the request will look like this:
darrelmiller commentedon May 11, 2020
Peter Ombwa (@peombwa) I think we need to add this "additionalProperties" to every entity, regardless of whether OpenType is true or not. Also, in the other SDKs we call it "additionalData" not "additionalProperties". Let's discuss further.
KirkMunro commentedon Jun 9, 2020
My recommendation would be as follows:
-PropertyValuesparameter of typeIDictionary.-BodyParameter. i.e. leave-BodyParameterfor the most advanced cases where the cmdlet parameters don't work for you, and use the explicitly defined parameters (e.g.-DisplayName,-Description) combined with the flexible-PropertyValuesparameter (which is the property bag) to build the request body that will be sent to Graph.-BodyParameteras-RequestBody, and give it two aliases:BodyParameterandBody.RequestBodyis a more accurate and descriptive name, and-Bodyis a parameter onInvoke-WebRequestandInvoke-RestMethod, so there is familiarity and ease of discovery. The "Parameter" portion of-BodyParameterseems irrelevant given that it is a PowerShell parameter."template@odata.bind" = "https://graph.microsoft.com/beta/teamsTemplates('standard')", which is a JSON way of indicating that you want to apply a built-in template to a team, simply use-Template $templateor-PropertyValues @{Template = $template}, and handle the conversion to JSON internally.With this in place, assuming I already did something like this:
I could then do this:
or this:
or this:
or if I want access to the raw request, I could do this:
These would all work. The first three would simply build the JSON request body that you are sending to Graph to do the work in the last one, rather than have you craft it yourself.
Also, the idea of "additionalProperties" or "additionalData" seems unnecessary here, especially given that the Graph endpoint doesn't need or use the extra nesting of properties when it is invoked like this:
Why add an extra level of nesting when Graph itself doesn't need it?
rhinomerton commentedon Jul 28, 2020
Could you just fix the -Template parameter rather than adding a new feature AdditionalProperties? The property is already explicit. If you do however require Template in AdditionalProperties, please remove the -Template parameter.
peombwa commentedon Sep 24, 2020
This has be fixed in v1.0,
Install-Module Microsoft.Graph -AllowClobber -Force.Updated teams samples can be found here - https://github.com/microsoftgraph/msgraph-sdk-powershell/blob/dev/samples/5-Teams.ps1.
kpinel commentedon Jul 22, 2022
I know this is an old post but what about adding additional owners? You know, automation and stuff.
It just seems that we are adding graph structure rather than doing this using cmdlet parameters and having the module to the JSON transform