Skip to content

Commit

Permalink
Fix #3703 - issue with IsFavoriteByDefault parameter in creating team…
Browse files Browse the repository at this point in the history
…s channel (#3712)

* Fix #3703 - issue with IsFavoriteByDefault parameter.

* Updated docs with bold text

* Update Add-PnPTeamsChannel.md

---------

Co-authored-by: Gautam Sheth <[email protected]>
  • Loading branch information
gautamdsheth and Gautam Sheth authored Jan 28, 2024
1 parent e601d90 commit 0b1b7b2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions documentation/Add-PnPTeamsChannel.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -156,4 +157,4 @@ Accept wildcard characters: False
## RELATED LINKS
[Microsoft 365 Patterns and Practices](https://aka.ms/m365pnp)
[Microsoft 365 Patterns and Practices](https://aka.ms/m365pnp)
1 change: 1 addition & 0 deletions src/Commands/Teams/AddTeamsChannel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/Commands/Utilities/TeamsUtility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,7 @@ public static async Task<TeamChannel> AddChannelAsync(string accessToken, PnPCon
}
else
{
channel.IsFavoriteByDefault = isFavoriteByDefault;
channel.IsFavoriteByDefault = null;
return await GraphHelper.PostAsync<TeamChannel>(connection, $"v1.0/teams/{groupId}/channels", channel, accessToken);
}
}
Expand Down

0 comments on commit 0b1b7b2

Please sign in to comment.