Invoke-FabricDatasetRefresh
Triggers a refresh of a Power BI dataset.
Syntax
Invoke-FabricDatasetRefresh [-DatasetId] <guid> [[-WorkspaceId] <guid>] [[-NotifyOption] <string>]
[[-Type] <string>] [[-CommitMode] <string>] [[-MaxParallelism] <int>] [[-RetryCount] <int>]
[[-Timeout] <string>] [[-EffectiveDate] <datetime>] [[-ApplyRefreshPolicy] <bool>]
[[-Objects] <hashtable[]>] [-WhatIf] [-Confirm] [<CommonParameters>]Description
Calls the Power BI REST API to trigger an on-demand refresh for a specified dataset. When WorkspaceId is supplied the request targets the dataset inside a specific workspace (groups/{groupId}/datasets/{datasetId}/refreshes); otherwise it targets the dataset in My Workspace (datasets/{datasetId}/refreshes).
Providing any parameter beyond NotifyOption triggers an enhanced refresh (requires Premium or Fabric capacity). Shared capacity supports only NotifyOption and is limited to 8 refreshes per day.
Examples
Example 1
Triggers a simple refresh of a dataset in My Workspace.
Invoke-FabricDatasetRefresh -DatasetId "12345678-90ab-cdef-1234-567890abcdef"Example 2
Triggers a full refresh of a dataset in a specific workspace with email notification on failure.
Invoke-FabricDatasetRefresh `
-DatasetId "12345678-90ab-cdef-1234-567890abcdef" `
-WorkspaceId "abcdef12-3456-7890-abcd-ef1234567890" `
-Type Full `
-NotifyOption MailOnFailureExample 3
Triggers an enhanced refresh targeting specific tables only.
Invoke-FabricDatasetRefresh `
-DatasetId "12345678-90ab-cdef-1234-567890abcdef" `
-WorkspaceId "abcdef12-3456-7890-abcd-ef1234567890" `
-Objects @(@{ table = 'Sales' }, @{ table = 'Date' }) `
-CommitMode PartialBatchParameters
| Name | Type | Req. | Pos. | Pipeline | Description |
|---|---|---|---|---|---|
| -DatasetId | guid | ✓Required | 0 | – | (Mandatory) The unique identifier of the dataset to refresh. |
| -ApplyRefreshPolicy | bool | 9 | – | (Optional) Whether to apply the configured incremental refresh policy. Triggers an enhanced refresh when specified. Default: False |
|
| -CommitMode | string | 4 | – | (Optional) Determines whether objects are committed in batches or only when complete. Valid values: Transactional, PartialBatch. Triggers an enhanced refresh when specified. |
|
| -Confirmalias: cf | switch | Named | – | Prompts you for confirmation before running the cmdlet. |
|
| -EffectiveDate | datetime | 8 | – | (Optional) If an incremental refresh policy is applied, overrides the current date used to determine the rolling window period. Triggers an enhanced refresh when specified. |
|
| -MaxParallelism | int | 5 | – | (Optional) The maximum number of threads on which to run parallel processing commands. Triggers an enhanced refresh when specified. Default: 0 |
|
| -NotifyOption | string | 2 | – | (Optional) Mail notification preference for the refresh. Valid values: NoNotification, MailOnFailure, MailOnCompletion. Defaults to NoNotification. Not applicable to enhanced refreshes or service principal operations. Default: NoNotification |
|
| -Objects | hashtable[] | 10 | – | (Optional) An array of hashtables specifying specific tables and/or partitions to process. Each entry should contain 'table' and optionally 'partition' keys. Triggers an enhanced refresh when specified. Example: @(@{ table = 'Sales' }, @{ table = 'Date'; partition = 'Date-2024' }) |
|
| -RetryCount | int | 6 | – | (Optional) The number of times the operation is retried before failing. Triggers an enhanced refresh when specified. Default: 0 |
|
| -Timeout | string | 7 | – | (Optional) The timeout per individual refresh attempt, in HH:MM:SS format (max 24 hours total including retries). Defaults to 5 hours. Triggers an enhanced refresh when specified. |
|
| -Type | string | 3 | – | (Optional) The type of processing to perform. Valid values: Full, ClearValues, Calculate, DataOnly, Automatic, Defragment. Triggers an enhanced refresh when specified. |
|
| -WhatIfalias: wi | switch | Named | – | Runs the command in a mode that only reports what would happen without performing the actions. |
|
| -WorkspaceIdalias: GroupId | guid | 1 | – | (Optional) The unique identifier of the workspace that contains the dataset. When omitted, the My Workspace endpoint is used. |
This cmdlet also supports the common parameters, such as -Verbose and -ErrorAction. See about_CommonParameters.
Notes
- Requires a valid Power BI / Fabric token (call
Connect-FabricAccountfirst). - Calls
Confirm-TokenStateto ensure token validity before making the API request. - The API responds with 202 Accepted; the refresh runs asynchronously in the background.
- Use
Get-FabricDatasetRefreshHistoryto monitor refresh status.
Author: Kamil Nowinski