pnp / powershell

PnP PowerShell
https://pnp.github.io/powershell
MIT License
635 stars 329 forks source link

[BUG] Get-PnPTeamsChannel 'MembershipType' property returns 'unknownFutureValue' if Teams Channel is a Shared Channel #4043

Closed djtrustgod closed 1 month ago

djtrustgod commented 1 month ago

Expected behavior

Returned value should be 'Shared'

Actual behavior

Returned value is 'unknownFutureValue'

Steps to reproduce behavior

$channel = Get-PnPTeamsChannel -Team "Team 1" -Identity "Shared Channel 1" $channel.MembershipType

What is the version of the Cmdlet module you are running?

2.4.0

Which operating system/environment are you running PnP PowerShell on?

jackpoz commented 1 month ago

According to https://learn.microsoft.com/en-us/graph/api/resources/channel?view=graph-rest-1.0#properties :

Note that you must use the Prefer: include-unknown-enum-members request header to get the following value in this evolvable enum: shared.

Testing this in Graph Explorer without and with the include-unknown-enum-members header:

  1. Without include-unknown-enum-members image

  2. With include-unknown-enum-members image

A bit unsure if this header should be added everywhere when calling GET /teams/{team-id}/channels as that will change the value returned, so letting the maintainers decide.

jackpoz commented 1 month ago

I opened a PR at https://github.com/pnp/powershell/pull/4054 with the least invasive changes, including the header only when needed.