In this article, I will briefly show how to update parameters inside a Power BI semantic model using PowerShell.
Typically, in Microsoft Fabric, deployment pipelines are used to handle this when a semantic model is promoted from one workspace to another.
However, many organizations do not have access to Power BI Premium or Microsoft Fabric, but still need to update parameters such as the SQL server name or database name. In such cases, a PowerShell script is a practical and effective solution.
A key prerequisite is that the semantic model is designed in a way that the server and database names are controlled via Power Query parameters. Once this is in place, these parameters can be modified after deployment directly through the Power BI Service or automated using PowerShell.

These settings can be updated quite easily using PowerShell. The following script can be used to adjust the parameter values accordingly.
# Name of the target Power BI workspace
$targetWorkspaceName = "LB2"
# Name of the dataset (semantic model) inside the workspace
$datasetName = "Report"
# Value for the Power BI dataset parameter "servername"
$servername = "SQL-PROD"
# Value for the Power BI dataset parameter "database"
$database = "Sales"
# Resolve workspace ID by name
$targetWorkspaceId = (
Get-PowerBIWorkspace -All |
Where-Object Name -eq $targetWorkspaceName |
Select-Object -First 1
).Id
# Resolve dataset ID by name
$datasetId = (
Get-PowerBIDataset -WorkspaceId $targetWorkspaceId |
Where-Object Name -eq $datasetName |
Select-Object -First 1
).Id
# Build the request body to update dataset parameters
$paramBody = @{
updateDetails = @(
@{ name = "servername"; newValue = $servername },
@{ name = "database"; newValue = $database }
)
} | ConvertTo-Json -Depth 5
# Update dataset parameters in the target workspace/dataset
Invoke-PowerBIRestMethod `
-Method Post `
-Url "groups/$targetWorkspaceId/datasets/$datasetId/Default.UpdateParameters" `
-Body $paramBody `
-ContentType "application/json" | Out-Null
After executing this script, the parameters in the Power BI Service web interface will appear as shown below.

In upcoming posts, I will demonstrate how gateway connections can also be updated and managed using PowerShell.