From 791959c8750c38b765ad91a9a8f7cce5c08535c4 Mon Sep 17 00:00:00 2001 From: Gautam Sheth Date: Sun, 28 Jan 2024 18:42:47 +0200 Subject: [PATCH 1/3] Fix #3703 - issue with IsFavoriteByDefault parameter. --- documentation/Add-PnPTeamsChannel.md | 3 ++- src/Commands/Teams/AddTeamsChannel.cs | 1 + src/Commands/Utilities/TeamsUtility.cs | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/documentation/Add-PnPTeamsChannel.md b/documentation/Add-PnPTeamsChannel.md index 7eb7d995a..907710418 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 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); } } From f0e43f18e80a09396e7fe8eed652cf0a39107efd Mon Sep 17 00:00:00 2001 From: Gautam Sheth Date: Sun, 28 Jan 2024 18:44:22 +0200 Subject: [PATCH 2/3] Updated docs with bold text --- documentation/Add-PnPTeamsChannel.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/Add-PnPTeamsChannel.md b/documentation/Add-PnPTeamsChannel.md index 907710418..ed62c2667 100644 --- a/documentation/Add-PnPTeamsChannel.md +++ b/documentation/Add-PnPTeamsChannel.md @@ -100,7 +100,7 @@ Accept wildcard characters: False ### -IsFavoriteByDefault 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. ** +**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 From d4505cc5ea0b5974f628222960b8c459c26413b5 Mon Sep 17 00:00:00 2001 From: Gautam Sheth Date: Sun, 28 Jan 2024 18:48:54 +0200 Subject: [PATCH 3/3] Update Add-PnPTeamsChannel.md --- documentation/Add-PnPTeamsChannel.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/documentation/Add-PnPTeamsChannel.md b/documentation/Add-PnPTeamsChannel.md index ed62c2667..46db3026c 100644 --- a/documentation/Add-PnPTeamsChannel.md +++ b/documentation/Add-PnPTeamsChannel.md @@ -100,7 +100,7 @@ Accept wildcard characters: False ### -IsFavoriteByDefault 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.** +**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 @@ -157,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)