Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get-MgUserPhotoContent: Cannot set percent because PercentComplete cannot be greater than 100. (Parameter 'value') #2487

Closed
jpawlowski opened this issue Dec 10, 2023 · 1 comment
Assignees

Comments

@jpawlowski
Copy link

Describe the bug
Most of the time, the command Get-MgUserPhotoContent does not seem to handle visual progress bar properly as the following error message is given:

Get-MgUserPhotoContent_Get: Cannot set percent because PercentComplete cannot be greater than 100. (Parameter 'value')
Actual value was 2147483647.

The error appears with production and beta MgGraph modules.

To Reproduce
Steps to reproduce the behavior:

$TempFile = New-TemporaryFile
Get-MgUserPhotoContent -UserId user@example.com -OutFile $TempFile.FullName -WarningAction SilentlyContinue

Expected behavior
The error message should not appear so that the command can be used without -ErrorAction SilentlyContinue and the script is not interrupted.

Debug Output

DEBUG: [CmdletException]: Received exception with message 'PSArgumentOutOfRangeException - Cannot set percent because PercentComplete cannot be greater than 100. (Parameter 'value')
Actual value was 2147483647. :    at System.Management.Automation.ProgressRecord.set_PercentComplete(Int32 value)
   at Microsoft.Graph.Beta.PowerShell.PSCmdletExtensions.GetProgress(ProgressRecord currentProgressRecord, Stream stream)
   at Microsoft.Graph.Beta.PowerShell.PSCmdletExtensions.WriteToStream(PSCmdlet cmdlet, Stream inputStream, Stream outputStream, String downloadUrl, CancellationToken cancellationToken)
   at Microsoft.Graph.Beta.PowerShell.PSCmdletExtensions.WriteToFile(PSCmdlet cmdlet, HttpResponseMessage response, Stream inputStream, String filePath, CancellationToken cancellationToken)
   at Microsoft.Graph.Beta.PowerShell.Cmdlets.GetMgBetaUserPhotoContent_Get.on2Xx(HttpResponseMessage responseMessage, Task`1 response)
   at Microsoft.Graph.Beta.PowerShell.Users.UserGetPhotoContent_Call(HttpRequestMessage request, Func`3 on2Xx, Func`3 onDefault, IEventListener eventListener, ISendAsync sender)
   at Microsoft.Graph.Beta.PowerShell.Users.UserGetPhotoContent_Call(HttpRequestMessage request, Func`3 on2Xx, Func`3 onDefault, IEventListener eventListener, ISendAsync sender)
   at Microsoft.Graph.Beta.PowerShell.Users.UserGetPhotoContent(String userId, Func`3 on2Xx, Func`3 onDefault, IEventListener eventListener, ISendAsync sender)
   at Microsoft.Graph.Beta.PowerShell.Cmdlets.GetMgBetaUserPhotoContent_Get.ProcessRecordAsync()'
Get-MgBetaUserPhotoContent_Get: Cannot set percent because PercentComplete cannot be greater than 100. (Parameter 'value')
Actual value was 2147483647.
DEBUG: [CmdletEndProcessing]: - Get-MgBetaUserPhotoContent end processing.

Module Version

ModuleType Version    PreRelease Name                                ExportedCommands
---------- -------    ---------- ----                                ----------------
Script     2.10.0                Microsoft.Graph.Authentication      {Add-MgEnvironment, Connect-MgGraph, Disconnect-MgGraph, Get-MgContext…}
Script     2.10.0                Microsoft.Graph.Beta.Users          {Get-MgBetaUser, Get-MgBetaUserAppRoleAssignedResource, Get-MgBetaUserAppRoleAssignedResourceCount, Get-MgBetaUserCount…}
Script     2.10.0                Microsoft.Graph.Groups              {Add-MgGroupDriveListContentTypeCopy, Add-MgGroupDriveListContentTypeCopyFromContentTypeHub, Add-MgGroupFavorite, Add-MgGroupSite…}
Script     2.10.0                Microsoft.Graph.Identity.Directory… {Confirm-MgContactMemberGroup, Confirm-MgContactMemberObject, Confirm-MgContractMemberGroup, Confirm-MgContractMemberObject…}
Script     2.10.0                Microsoft.Graph.Identity.SignIns    {Confirm-MgRiskyServicePrincipalCompromised, Confirm-MgRiskyUserCompromised, Get-MgDataPolicyOperation, Get-MgDataPolicyOperationCount…}
Script     2.10.0                Microsoft.Graph.Users               {Get-MgUser, Get-MgUserCount, Get-MgUserCreatedObject, Get-MgUserCreatedObjectAsServicePrincipal…}
Script     2.10.0                Microsoft.Graph.Users.Actions       {Add-MgUserChatMember, Add-MgUserDriveListContentTypeCopy, Add-MgUserDriveListContentTypeCopyFromContentTypeHub, Clear-MgUserChatMessageReaction…}

Environment Data

Name                           Value
----                           -----
PSVersion                      7.4.0
PSEdition                      Core
GitCommitId                    7.4.0
OS                             Darwin 23.1.0 Darwin Kernel Version 23.1.0: Mon Oct  9 21:28:45 PDT 2023; root:xnu-10002.41.9~6/RELEASE_ARM64_T6020
Platform                       Unix
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0
@timayabi2020
Copy link
Contributor

Hi @jpawlowski apologies for not responding on this issue earlier. Please upgrade to the latest SDK version (2.25.0) and open an issue targeting that version if you are still experiencing the same.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants