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
{{ message }}
Repository navigation
Cannot process argument transformation on parameter 'Body'. Cannot convert the "<h1>Hello</h1>" value of type | "System.String" to type "Microsoft.Graph.PowerShell.Models.IMicrosoftGraphItemBody" #339
After upgrading from 0.7.1 to 0.9.1 my scripts are now failing when trying to send a simple HTML message.
Cannot process argument transformation on parameter 'Body'. Cannot convert the "Hello World" value of type
| "System.String" to type "Microsoft.Graph.PowerShell.Models.IMicrosoftGraphItemBody"
Looks as though the parameters options have now changes from -BodyContent to -Body.
Line |
12353 | $scriptCmd = {& $wrappedCmd @PSBoundParameters}
| ~~~~~~~~~~~~~~~~~~
| Cannot bind parameter 'Body'. Cannot convert the "Microsoft.Graph.PowerShell.Models.MicrosoftGraphItemBody"
| value of type "Microsoft.Graph.PowerShell.Models.MicrosoftGraphItemBody" to type
| "Microsoft.Graph.PowerShell.Models.IMicrosoftGraphItemBody".
Thanks Peter for the response. I'm still not having much luck using Pascal Case I'm afraid. I've copied both examples (thanks for the tip RE: debug and the alternative way of sending the message) but I'm now getting a new error.
I've tried PS5.1 and 7.1 P6, but they both are giving me the same error:
New-MgTeamChannelMessage_CreateExpanded1: C:\Users\xxxx\Documents\PowerShell\Modules\Microsoft.Graph.Teams.Team\0.9.1\exports\v1.0-beta\ProxyCmdletDefinitions.ps1:12353:23
Line |
12353 | $scriptCmd = {& $wrappedCmd @PSBoundParameters}
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| An item with the same key has already been added. Key: content
Peter Ombwa (@peombwa) I reproduce what thenecroscope is seeing as well using the two workaround commands you posted above. Let me know if I can help provide any further information.
Activity
thenecroscope commentedon Aug 17, 2020
The examples will probably need to be updated here also:
https://github.com/microsoftgraph/msgraph-sdk-powershell/blob/dev/samples/5-Teams.ps1
thanks again
thenecroscope commentedon Aug 17, 2020
If I try this, I'm hitting the following error:
New-MgTeamChannelMessage -ChannelId $teamsConfigItemChannelID -TeamId $teamsConfigItemTeamID -Body @{content = "hello"}
Line |
12353 | $scriptCmd = {& $wrappedCmd @PSBoundParameters}
| ~~~~~~~~~~~~~~~~~~
| Cannot bind parameter 'Body'. Cannot convert the "Microsoft.Graph.PowerShell.Models.MicrosoftGraphItemBody"
| value of type "Microsoft.Graph.PowerShell.Models.MicrosoftGraphItemBody" to type
| "Microsoft.Graph.PowerShell.Models.IMicrosoftGraphItemBody".
peombwa commentedon Aug 18, 2020
Thanks for reporting this bug. We've traced this issue to our code generator which expects
contentto start with uppercaseCi.e.Content.We are currently working on fix for this. A temporary workaround is to ensure your property names are in PascalCase.
or
thenecroscope commentedon Aug 18, 2020
Thanks Peter for the response. I'm still not having much luck using Pascal Case I'm afraid. I've copied both examples (thanks for the tip RE: debug and the alternative way of sending the message) but I'm now getting a new error.
I've tried PS5.1 and 7.1 P6, but they both are giving me the same error:
New-MgTeamChannelMessage_CreateExpanded1: C:\Users\xxxx\Documents\PowerShell\Modules\Microsoft.Graph.Teams.Team\0.9.1\exports\v1.0-beta\ProxyCmdletDefinitions.ps1:12353:23
Line |
12353 | $scriptCmd = {& $wrappedCmd @PSBoundParameters}
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| An item with the same key has already been added. Key: content
thoughts?
thanks again
jasonjoh commentedon Aug 19, 2020
Peter Ombwa (@peombwa) I reproduce what thenecroscope is seeing as well using the two workaround commands you posted above. Let me know if I can help provide any further information.
peombwa commentedon Sep 29, 2020
This was fixed with 1.0.1.
Install-Module Microsoft.Graph -AllowClobber -Force.