msgraph-sdk-powershell icon indicating copy to clipboard operation
msgraph-sdk-powershell copied to clipboard

`Find-MgGraphCommand -Command New-MgGroupMember` fails

Open tomatsue opened this issue 1 year ago • 6 comments

Describe the bug

When running Find-MgGraphCommand -Command New-MgGroupMember, it fails and shows the error message below.

> Find-MgGraphCommand -Command New-MgGroupMember
Find-MgGraphCommand : 'New-MgGroupMember' is not a valid Microsoft Graph PowerShell command. Please check the name and try again.

It appears that New-MgGroupMember is missing from MgCommandMetadata.json.

Expected behavior

Return the information of New-MgGroupMember.

How to reproduce

Execute Find-MgGraphCommand -Command New-MgGroupMember.

SDK Version

2.17.0

Latest version known to work for scenario above?

No response

Known Workarounds

No response

Debug output

Click to expand log
> Find-MgGraphCommand -Command New-MgGroupMember -Debug
デバッグ: Reading MgCommandMetadata from session object.

デバッグ: Received Command: New-MgGroupMember

デバッグ: Reading MgLegacyCommandMapping from session object.

デバッグ: Resolved Command: New-MgGroupMember

デバッグ: Matching Command: New-MgGroupMember

デバッグ: Matching ApiVersion:

Find-MgGraphCommand : 'New-MgGroupMember' is not a valid Microsoft Graph PowerShell command. Please check the name and
try again.
発生場所 行:1 文字:1
+ Find-MgGraphCommand -Command New-MgGroupMember -Debug
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Find-MgGraphCommand

Configuration

PSVersion 5.1.22621.2506 PSEdition Desktop PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...} BuildVersion 10.0.22621.2506 CLRVersion 4.0.30319.42000 WSManStackVersion 3.0 PSRemotingProtocolVersion 2.3 SerializationVersion 1.1.0.1

Other information

No response

tomatsue avatar May 28 '24 08:05 tomatsue

Hi @tomatsue ,

You shall be able to use New-MgGroupMemberByRef cmdlet: New-MgGroupMemberByRef (Microsoft.Graph.Groups) | Microsoft Learn

while we are looking into the issue with missing docs for the New-MgGroupMember cmdlet.

petrhollayms avatar May 29 '24 14:05 petrhollayms

Hi @petrhollayms,

Could you explain the difference between New-MgGroupMember and New-MgGroupMemberByRef? Both commands seem to perform the same function. Additionally, I couldn't find any mention of New-MgGroupMemberByRef in the following documentation. https://learn.microsoft.com/en-us/entra/identity/users/groups-settings-v2-cmdlets#add-members

tomatsue avatar Jun 03 '24 07:06 tomatsue

Hi @tomatsue we don't have New-MgGroupMember cmdlet in the SDK. I will reach out to the doc owners to update the doc. The correct cmdlet to use is New-MgGroupMemberByRef and here is the related Microsoft Graph Api reference for that command https://learn.microsoft.com/en-us/graph/api/group-post-members?view=graph-rest-1.0&tabs=http

timayabi2020 avatar Jun 25 '24 13:06 timayabi2020

@msewaweru please note this.

timayabi2020 avatar Jul 04 '24 14:07 timayabi2020

To add to this, Find-MgGraphCommand New-MgGroupMemberByRef does not return any permissions.

DanielBradley1 avatar Jul 10 '24 08:07 DanielBradley1

@DanielBradley1 kindly open a separate issue related to New-MgGroupMemberByRef permissions for proper visibility and tracking.

timayabi2020 avatar Jul 11 '24 09:07 timayabi2020

Closing this because the online reference doc was updated to remove the document non-existent cmdlet.

timayabi2020 avatar Jan 29 '25 09:01 timayabi2020