diff --git a/documentation/Add-PnPTeamsChannel.md b/documentation/Add-PnPTeamsChannel.md index 7eb7d995a..46db3026c 100644 --- a/documentation/Add-PnPTeamsChannel.md +++ b/documentation/Add-PnPTeamsChannel.md @@ -99,7 +99,8 @@ Accept wildcard characters: False ``` ### -IsFavoriteByDefault -Allows you to specify if the channel is by default visible for members +Allows you to specify if the channel is by default visible for members. +**This parameter is obsolete. [Microsoft Graph API docs](https://learn.microsoft.com/en-us/graph/api/resources/channel?view=graph-rest-1.0#properties) mention that it only works when you create a channel in Teams creation request. It will be removed in a future version.** ```yaml Type: Boolean @@ -156,4 +157,4 @@ Accept wildcard characters: False ## RELATED LINKS -[Microsoft 365 Patterns and Practices](https://aka.ms/m365pnp) \ No newline at end of file +[Microsoft 365 Patterns and Practices](https://aka.ms/m365pnp) diff --git a/src/Commands/Teams/AddTeamsChannel.cs b/src/Commands/Teams/AddTeamsChannel.cs index 2ef379906..b458da3e8 100644 --- a/src/Commands/Teams/AddTeamsChannel.cs +++ b/src/Commands/Teams/AddTeamsChannel.cs @@ -40,6 +40,7 @@ public class AddTeamsChannel : PnPGraphCmdlet [Parameter(Mandatory = true, ParameterSetName = ParameterSET_PRIVATE)] public string OwnerUPN; + [Obsolete("It is not supported by Microsoft Graph API now. It will be removed in the next major release.")] [Parameter(Mandatory = false, ParameterSetName = ParameterSET_SPECIFIC)] [Parameter(Mandatory = false, ParameterSetName = ParameterSET_STANDARD)] public bool IsFavoriteByDefault; diff --git a/src/Commands/Utilities/TeamsUtility.cs b/src/Commands/Utilities/TeamsUtility.cs index 627057c60..6243d8a09 100644 --- a/src/Commands/Utilities/TeamsUtility.cs +++ b/src/Commands/Utilities/TeamsUtility.cs @@ -667,7 +667,7 @@ public static async Task AddChannelAsync(string accessToken, PnPCon } else { - channel.IsFavoriteByDefault = isFavoriteByDefault; + channel.IsFavoriteByDefault = null; return await GraphHelper.PostAsync(connection, $"v1.0/teams/{groupId}/channels", channel, accessToken); } }