msgraph-sdk-powershell
msgraph-sdk-powershell copied to clipboard
`Find-MgGraphCommand -Command New-MgGroupMember` fails
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
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.
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
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
@msewaweru please note this.
To add to this, Find-MgGraphCommand New-MgGroupMemberByRef does not return any permissions.
@DanielBradley1 kindly open a separate issue related to New-MgGroupMemberByRef permissions for proper visibility and tracking.
Closing this because the online reference doc was updated to remove the document non-existent cmdlet.