Forum Discussion
charlieswing
Microsoft Employee
4 years agoInvoke-PowerBIRestMethod: $top parameter doesn't work when on Refresh history (GET /refreshes)
I am trying to use the following GET refreshes method (using Invoke-PowerBIRestMethod Powershell cmdlet) to retrieve refresh history on a particular dataset. I'm wanting to use the {$top} parameter (...
- 4 years ago
Hi charlieswing , I found the solution; it is not a Power BI bug. The problem is when you add a $ in text using PowerShell it is interpreted as a variable; in other words, you have to escape the $ with `
$workspace_id = "your_workspace_id" $dataset_id = "your_dataset_id" $url_refresh_history = "https://api.powerbi.com/v1.0/myorg/groups/"+$workspace_id+"/datasets/"+$dataset_id+"/refreshes?`$top=2"
AEsquivel-AMPM
4 years agoNew Member
Hi charlieswing , I found the solution; it is not a Power BI bug. The problem is when you add a $ in text using PowerShell it is interpreted as a variable; in other words, you have to escape the $ with `
$workspace_id = "your_workspace_id"
$dataset_id = "your_dataset_id"
$url_refresh_history = "https://api.powerbi.com/v1.0/myorg/groups/"+$workspace_id+"/datasets/"+$dataset_id+"/refreshes?`$top=2"