Skip to content

Set-MgUserPhotoContent not working in PowerShell 5 #2645

Closed
@timayabi2020

Description

@timayabi2020

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

Describe the bug

The command fails with missing assembly error Microsoft.Win32.Registry.dll when used in a PowerShell 5 environment.

To Reproduce
Steps to reproduce the behavior:

  1. Open PowerShell 5
  2. Connect to graph using connect-mggraph -scopes "ProfilePhoto.ReadWrite.All,User.ReadWrite,User.ReadWrite.All"
  3. Execute Set-MgUserPhotoContent -UserId <UserId> -InFile "<Path to your image file>"

Expected behavior

No error thrown

Debug Output

Module Version
2.16.0

Environment Data
PowerShell 5

Screenshots

image

Additional context

The cmdlet works in PowerShell 7

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions