Skip to content

Commit 103935d

Browse files
committed
Get-FabricDatasetRefreshes must use PowerBI API
1 parent 9f4f1e9 commit 103935d

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

source/Public/Get-FabricDatasetRefreshes.ps1

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,14 @@ function Get-FabricDatasetRefreshes {
4343
# Check if the dataset is refreshable.
4444
if ($di.isrefreshable -eq "True") {
4545
# Get a list of all the refreshes for the dataset.
46-
$results = (Invoke-FabricRestMethod -Method get -uri ("datasets/" + $di.id + "/Refreshes") | ConvertFrom-Json)
46+
$results = Invoke-FabricRestMethod -Method get -PowerBIApi -uri ("datasets/" + $di.id + "/Refreshes")
4747

4848
# Create a PSCustomObject with the information about the refresh.
4949
$refresh = [PSCustomObject]@{
5050
Clock = Get-Date
51+
WorkspaceId = $workspaceId
5152
Workspace = $w.name
53+
DatasetId = $di.Id
5254
Dataset = $di.Name
5355
refreshtype = $results.value[0].refreshType
5456
startTime = $results.value[0].startTime

source/Public/Invoke-FabricRestMethod.ps1

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,8 @@ Function Invoke-FabricRestMethod {
6666

6767
if ($Uri -notmatch '^https?://.*') {
6868
$Uri = "{0}/{1}" -f $baseUrl, $Uri
69-
if ($PowerBIApi) {
70-
Write-Message -Message "PowerBIApi param is ignored when full Uri is provided." -Level Warning
71-
}
69+
} elseif ($PowerBIApi) {
70+
Write-Message -Message "PowerBIApi param is ignored when full Uri is provided." -Level Warning
7271
}
7372
Write-Message -Message "Target API Endpoint: $Uri" -Level Verbose
7473

0 commit comments

Comments
 (0)