microsoftgraph / microsoftgraph/msgraph-sdk-powershell

New-MgTeamChannelMember fails with "Parameter set cannot be resolved using the specified named parameters."

Open
#3,471 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Needs: Directive type:bug
Dominant language
C#
Stars
898
Forks
230
Avg merge
2d 5h
Merged PRs (30d)
31

Description

Describe the bug

When running the command "New-MgTeamChannelMember" using PowerShell 5.1 or 7.4 we receive an error message.

Error:
Parameter set cannot be resolved using the specified named parameters. One or more parameters issued cannot be used together or an insufficient number of parameters were provided.

This is also discussed in https://github.com/microsoftgraph/msgraph-sdk-powershell/discussions/3370

Module:
Microsoft.Graph.Teams v2.33.0

Expected behavior

Running the command should add the user to the private team channel.

How to reproduce
  1. Execute New-MgTeamChannelMember with the -TeamId, -ChannelId, and -BodyParameters
SDK Version

2.33.0

Latest version known to work for scenario above?

No response

Known Workarounds

One known workaround is to use the Graph REST API instead of the cmdlet New-MgTeamChannelMember

Debug output
Click to expand log ```
</details>


### Configuration

- OS: Windows Server 2019
- 64 bit
- PowerShell details
PS C:\Windows\system32> $PSVersionTable

Name                           Value                                                                                                                                                               
----                           -----                                                                                                                                                               
PSVersion                      5.1.17763.8024                                                                                                                                                      
PSEdition                      Desktop                                                                                                                                                             
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}                                                                                                                                             
BuildVersion                   10.0.17763.8024                                                                                                                                                     
CLRVersion                     4.0.30319.42000                                                                                                                                                     
WSManStackVersion              3.0                                                                                                                                                                 
PSRemotingProtocolVersion      2.3                                                                                                                                                                 
SerializationVersion           1.1.0.1   

Name                           Value
----                           -----
PSVersion                      7.4.13
PSEdition                      Core
GitCommitId                    7.4.13
OS                             Microsoft Windows 10.0.17763
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0


### Other information

_No response_

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing New-MgTeamChannelMember with -TeamId, -ChannelId, and -BodyParameters on PowerShell 5.1 or 7.4, then inspect which parameter sets the cmdlet exposes. Done means the command accepts the documented inputs and adds a user to a private team channel without requiring the REST API workaround.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.