Leveraging the Power BI PowerShell Module
Power BI administrators can automate common tasks by developing PowerShell scripts which leverage commands included in the Microsoft Power BI Management PowerShell module such as Get-PowerBIWorkspace and Add-PowerBIWorkspaceUser. In addition, custom administrative solutions can be developed using the Power BI REST APIs and .NET client library. Using the Power BI REST API, administrators can automate the creation of workspaces and dashboards, publish workspace content, share workspace content, remove access to workspaces, delete workspaces, and much more.
This recipe demonstrates how to connect to Power BI via PowerShell and perform simple administrative functions.
Getting ready
To prepare for this recipe, follow these steps:
- Enable Power BI APIs in Tenant settings of the Power BI service:
Figure 10.28: Power BI APIs tenant settings in the Power BI service
- Make sure that you are a Power BI Administrator...