microsoft / microsoft/powerbi-powershell
task Canceled Get-PowerBIActivityEvent
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 413
- Forks
- 134
- Avg merge
- 33m
- Merged PRs (30d)
- 1
Description
I'm trying to extract the last 90 days of Power BI events with the command Get-PowerBIActivityEvent, it extracts some files but after a while it gives this error.
code:
$dateIn = (Get-Date).AddDays(-90)
$fimdateIn = (Get-Date)
$diasIn =
do {
$dateIn.ToString("yyyy-MM-ddT00:00:00")
$dateIn = $dateIn.AddDays(1)
}
until ($dateIn -gt $fimdateIn)
$dateEnd = (Get-Date).AddDays(-90)
$fimdateEnd = (Get-Date)
$diasEnd =
do {
$dateEnd.ToString("yyyy-MM-ddT23:59:59")
$dateEnd = $dateEnd.AddDays(1)
}
until ($dateEnd -gt $fimdateEnd)
for($i = 0; $i -lt $diasIn.Count ; $i++){
$inicial = $diasIn[$i]
$final = $diasEnd[$i]
$audit = Get-PowerBIActivityEvent -StartDateTime $inicial -EndDateTime $final | ConvertFrom-Json
$audit | Export-Csv -Path "\PowerBIAuditLog$i.csv" -NoTypeInformation
}

Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the reported loop using Get-PowerBIActivityEvent over daily 90-day intervals and capture when the command is canceled. Trace the command's activity-event request handling to identify the failure, then verify that the same extraction completes or produces a clear actionable error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- powershell
- Domain
- api, cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100