microsoft / microsoft/powerbi-powershell

task Canceled Get-PowerBIActivityEvent

Open
#232 3 comments 0 reactions 0 assignees View on GitHub

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

}

Screenshot_1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.