Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Get-MgReport* Cmdlets give PercentComplete error when overwriting a file

Aperta
#3,488 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
58/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
powershell
Ambito
cli

Direzione di ricerca

Inizia riproducendo la sequenza di sovrascrittura con Get-MgReportEmailActivityUserDetail, usando un outfile esistente e le opzioni di avanzamento e avviso di PowerShell fornite. Confronta i percorsi della prima esecuzione e della sovrascrittura per i cmdlet Get-MgReport*. Il lavoro è completato quando la sovrascrittura del file termina correttamente senza l’errore PercentComplete e produce l’output del report previsto.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Status: Needs Investigation type:bug
Describe the bug

When running any of the Get-MgReport* cmdlets, such as Get-MgReportEmailActivityUserDetail, you will receive the following PercentComplete error if the outfile already exists (hiding the progress and warnings to minimize noise):

>Get-MgReportEmailActivityUserDetail -period D180 -outfile emailactivity2.csv -ProgressAction SilentlyContinue -WarningAction SilentlyContinue

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

Get-MGReport* cmdlets should not run into the "Cannot set percent because PercentComplete cannot be greater than 100. (Parameter 'value')" error when completing successfully and overwriting an outfile.

How to reproduce

Write-Host "Make sure the output file doesn't already exist..."
Remove-Item C:\Example\emailactivity.csv -ErrorAction SilentlyContinue

Write-Host "Run the report to create the output file..."
Get-MgReportEmailActivityUserDetail -period D180 -outfile C:\Example\emailactivity.csv -ProgressAction SilentlyContinue -WarningAction SilentlyContinue

Write-Host "Run the report to a second time where it has to overwrite the output file... it generates the error."
Get-MgReportEmailActivityUserDetail -period D180 -outfile C:\Example\emailactivity.csv -ProgressAction SilentlyContinue -WarningAction SilentlyContinue

Write-Host "Delete the output file so we can show the error goes away... Inconsistent results when we don't pause after the file deletion..."
Remove-Item C:\Example\emailactivity.csv
Start-Sleep 5

Write-Host "Run the report a third time to show the error goes away when it doesn't have to overwrite the output file..."
Get-MgReportEmailActivityUserDetail -period D180 -outfile C:\Example\emailactivity.csv -ProgressAction SilentlyContinue -WarningAction SilentlyContinue
SDK Version

No response

Latest version known to work for scenario above?

2.34.0

Known Workarounds

No response

Debug output
No test tenant and debug output is sensitive ```
</details>


### Configuration

- OS: Windows 11 24H2
- Arch:  x64

Name                           Value
----                           -----
PSVersion                      7.5.4
PSEdition                      Core
GitCommitId                    7.5.4
OS                             Microsoft Windows 10.0.26100
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

### Other information

_No response_
Lingua principale
C#
Stelle
902
Fork
233
Merge medio
1g 3h
PR unite (30g)
24

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di microsoftgraph/msgraph-sdk-powershell

Tutte le issue di microsoftgraph/msgraph-sdk-powershell

Issue simili

Altre issue su C#

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.