Welcome to the PowerShell community for Microsoft Power BI. Here you will find resources and source for PowerShell modules targeting PowerBI.
For questions or issues using the modules, please log an issue and we will respond as quickly as possible.
Below is a table of the various Power BI PowerShell modules found in this repository.
Description | Module Name | PowerShell Gallery link |
---|---|---|
Rollup Module for Power BI Cmdlets | MicrosoftPowerBIMgmt |
|
Data module for Power BI Cmdlets | MicrosoftPowerBIMgmt.Data | |
Profile module for Power BI Cmdlets | MicrosoftPowerBIMgmt.Profile | |
Reports module for Power BI | MicrosoftPowerBIMgmt.Reports | |
Workspaces module for Power BI | MicrosoftPowerBIMgmt.Workspaces |
More documentation can be found at https://docs.microsoft.com/en-us/powershell/power-bi/overview.
- Windows PowerShell v3.0 and up with .NET 4.6.1 or above.
- PowerShell Core (v6) and up on any OS platform supported by PowerShell Core.
The cmdlets are available on PowerShell Gallery and can be installed in an elevated PowerShell session:
Install-Module -Name MicrosoftPowerBIMgmt
Optionally you could install individual modules (based on your needs) instead of the rollup module, for example if you only wanted the Workspaces module:
Install-Module -Name MicrosoftPowerBIMgmt.Workspaces
If you have an earlier version, you can update to the latest version by running:
Update-Module -Name MicrosoftPowerBIMgmt
If you want to uninstall all the Power BI PowerShell cmdlets, run the following in an elevated PowerShell session:
Get-Module MicrosoftPowerBIMgmt* -ListAvailable | Uninstall-Module -Force
Two scopes are supported by cmdlets that interact with Power BI entities:
- Individual is used to access entities that belong to the current user.
- Organization is used to access entities across the entire company. Only Power BI tenant admins are allowed to use.
Connect-PowerBIServiceAccount # or Login-PowerBIServiceAccount
Get all workspaces for the user:
Get-PowerBIWorkspace
Update the name or description of a user's workspace:
Set-PowerBIWorkspace -Scope Organization -Id "3244f1c1-01cf-457f-9383-6035e4950fdc" -Name "Test Name" -Description "Test Description"
Add a user to a given workspace:
Add-PowerBIWorkspaceUser -Scope Organization -Id 3244f1c1-01cf-457f-9383-6035e4950fdc -UserEmailAddress john@contoso.com -AccessRight Admin
Remove user's permissions from a given workspace:
Remove-PowerBIWorkspaceUser -Scope Organization -Id 3244f1c1-01cf-457f-9383-6035e4950fdc -UserEmailAddress john@contoso.com
Restores a deleted workspace:
Restore-PowerBIWorkspace -Id "3244f1c1-01cf-457f-9383-6035e4950fdc" -RestoredName "TestWorkspace" -AdminEmailAddress "john@contoso.com"
Get all reports for the user:
Get-PowerBIReport
If you find any bugs or would like to see certain functionality implemented for the PowerShell Cmdlets for Power BI, please file an issue here.
If your issue is broader than just the PowerShell cmdlets, please submit your feedback to the Power BI Community or the official Power BI Support site.
We track our roadmap of planned features in ROADMAP.md.
Security issues and bugs should be reported privately, via email, to the Microsoft Security Response Center (MSRC) at secure@microsoft.com.
You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Further information, including the MSRC PGP key, can be found in the Security TechCenter.
This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.
When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.
More information about contributing can be found in this CONTRIBUTING guide.