Forum Discussion
Power BI Dataset Description Export
Hi All,
I want to extract all the datasets alongwith their description using PowerShell but I could not find any API for this. Get-PowerBIDatset Cmdlet does not provide this information. Also tried Power BI Rest Api connector but could not see this detail. Has anybody any idea how to achieve this.
Any help would be appreciated.
Thanks,
Max
To retrieve the description of all the datasets in your Power BI workspace using PowerShell, you can use the Power BI REST API along with the Invoke-RestMethod cmdlet.
Here's an example PowerShell script that demonstrates how to retrieve the dataset names and descriptions:
$workspaceId = "<workspace_id>"
$accessToken = "<access_token>"
$uri = "https://api.powerbi.com/v1.0/myorg/groups/$workspaceId/datasets"$datasets = Invoke-RestMethod -Method Get -Uri $uri -Headers @{ Authorization = "Bearer $accessToken" }
foreach ($dataset in $datasets.value) {
Write-Host "Dataset Name: $($dataset.name)"
Write-Host "Dataset Description: $($dataset.description)"
}In this script, you will need to replace <workspace_id> and <access_token> with the ID of your Power BI workspace and a valid access token, respectively.
The script uses the Power BI REST API to retrieve a list of datasets in the specified workspace, and then loops through each dataset to retrieve its name and description. The dataset description is available in the description property of the dataset object.
You can further modify this script to export the dataset names and descriptions to a CSV file or any other desired output format.
2 Replies
- jaweher899Impactful Individual
To retrieve the description of all the datasets in your Power BI workspace using PowerShell, you can use the Power BI REST API along with the Invoke-RestMethod cmdlet.
Here's an example PowerShell script that demonstrates how to retrieve the dataset names and descriptions:
$workspaceId = "<workspace_id>"
$accessToken = "<access_token>"
$uri = "https://api.powerbi.com/v1.0/myorg/groups/$workspaceId/datasets"$datasets = Invoke-RestMethod -Method Get -Uri $uri -Headers @{ Authorization = "Bearer $accessToken" }
foreach ($dataset in $datasets.value) {
Write-Host "Dataset Name: $($dataset.name)"
Write-Host "Dataset Description: $($dataset.description)"
}In this script, you will need to replace <workspace_id> and <access_token> with the ID of your Power BI workspace and a valid access token, respectively.
The script uses the Power BI REST API to retrieve a list of datasets in the specified workspace, and then loops through each dataset to retrieve its name and description. The dataset description is available in the description property of the dataset object.
You can further modify this script to export the dataset names and descriptions to a CSV file or any other desired output format.
- AnonymousNot applicable
Thank you this worked