[BUG] Set-PnPTeamsChannel: IsFavoriteByDefault 'Nullable object must have a value.' #2424
Closed
1 of 6 tasks
Labels
bug
Something isn't working
Reporting an Issue or Missing Feature
If “Automatically show this channel in everyone’s channel list” (or in code “IsFavoriteByDefault”) is set to true, it is also saved as true but when it is set to false, NULL is saved.
When this “IsFavoriteByDefault” is NULL and the Set-PnPTeamsChannel function is triggered the execution of the commandlet will fail with a 'Nullable object must have a value.' Error.
Expected behavior
Updating the teams channel by calling the Set-PnPTeamsChannel function.
Actual behavior
'Nullable object must have a value.' Error.
Steps to reproduce behavior
Set the “IsFavoriteByDefault” to false (UI, MS Graph or PS) (NULL will be saved).
After this, the property is set to NULL.
When the Set-PnPTeamsChannel function is called again it will fail with a 'Nullable object must have a value.' Error.
This happens because “teamChannel.IsFavoriteByDefault” is NULL and the following code is called: “teamChannel.IsFavoriteByDefault.Value”
What is the version of the Cmdlet module you are running?
1.11.0
Which operating system/environment are you running PnP PowerShell on?
The text was updated successfully, but these errors were encountered: