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

'Remove-MgUserPhoto' Not Recognized in Microsoft.Graph.Users Module Version 2.13.0 and Grater

Open shmiyaza-MSKK opened this issue 1 year ago • 1 comments

Thanks for reporting the bug. Please ensure you've gone through the following checklist before opening an issue:

  • Make sure you can reproduce this issue using the latest released version of Microsoft.Graph or Microsoft.Graph.Beta.
  • Please search the existing issues to see if there has been a similar issue filed.
  • For issues related to authentication and service errors, please refer to our troubleshooting guide. For service issues, please open a question at https://developer.microsoft.com/graph/support.

Describe the bug After updating to version 2.13.0 of the Microsoft.Graph.Users module, the Remove-MgUserPhoto command is no longer recognized. The Get-Command cmdlet returns null when attempting to find the command within the module.

PS C:\Users\username> Get-Command -Module Microsoft.Graph.Users | ?{$_.Name -eq 'Remove-MgUserPhoto'}

To Reproduce Steps to reproduce the behavior:

  1. Install Microsoft.Graph.Users V2.13.0 or grater.
  2. Execute Remove-MgUserPhoto.

Debug Output No debug output.

Module Version Microsoft.Graph.Users: 2.12.0

Environment Data Name Value


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

Additional context Upon checking the OpenApiDocs, it appears that the DELETE method for users//photo/$value is missing, which might be the reason for the issue. https://github.com/microsoftgraph/msgraph-sdk-powershell/blob/31f1a583bf7390744ee07d389291696509642677/openApiDocs/v1.0/Users.yml#L4987

Also, we have confirmed that Remove-MgDirectoryDeletedItem command is also missing.

Workaround The current workaround is to either downgrade the module to version 2.12.0 or use the 'Invoke-MgGraphRequest' command instead.

shmiyaza-MSKK avatar Feb 25 '24 04:02 shmiyaza-MSKK

Issue logged and tracked in the metadata repo https://github.com/microsoftgraph/msgraph-metadata/issues/576

timayabi2020 avatar Feb 26 '24 20:02 timayabi2020