Microsoft Power BI PowerShell

repository·master·Indexed 19 days ago

https://github.com/microsoft/powerbi-powershell

PowerShell interface for managing Power BI resources, including workspaces, reports, datasets, and dashboards. Provides the MicrosoftPowerBIMgmt module for individual user management and tenant-wide administration, including tools for dataflow import/export, workspace restoration, and direct Power BI REST API calls via Invoke-PowerBIRestMethod.

Tokens
31.5K
Snippets
130
Records
163
Agent score
56%

What's inside microsoft-powerbi-powershell

  1. Overview of the MicrosoftPowerBIMgmt.Data Module

    master
    The MicrosoftPowerBIMgmt.Data module provides PowerShell cmdlets specifically designed for managing and interacting with Power BI datasets, data sources, dataflows, and tables. It allows for programmatic manipulation of data structures within the Power BI service, including adding rows, creating columns, and exporting dataflow definitions.
  2. Manage Power BI workspaces with MicrosoftPowerBIMgmt.Workspaces

    master
    The MicrosoftPowerBIMgmt.Workspaces module provides PowerShell cmdlets specifically designed for managing and interacting with Power BI workspaces. This includes creating new workspaces, retrieving lists of existing workspaces, updating workspace settings, and managing user permissions (adding or removing users, service principals, or groups).
  3. Configure the scope for Get-PowerBIImport

    master

    The -Scope parameter determines the breadth of the search.

    • Individual (Default): Returns only imports assigned to the calling user.
    • Organization: Returns all imports within the tenant. Note: You must be an administrator to use this scope.

    When using -Scope Organization, you can also use the -Filter parameter to apply an OData filter (case-sensitive, element names must start with lowercase).

    # Get imports for the current user
    Get-PowerBIImport -Scope Individual
    
    # Get all imports in the organization (requires admin rights)
    Get-PowerBIImport -Scope Organization
  4. Understand Power BI cmdlet scopes: Individual vs Organization

    master

    Cmdlets that interact with Power BI entities support two primary scopes:

    • Individual: Used to access entities that belong to the current authenticated user.
    • Organization: Used to access entities across the entire company. This scope is only available to Power BI tenant administrators.

    If a cmdlet does not have a -Scope parameter, it means the entity it manages does not support an Administrative API.

  5. Configure the scope for Get-PowerBIDashboard

    master

    The -Scope parameter determines the breadth of the dashboard search:

    • Individual (Default): Returns only dashboards assigned to the calling user.
    • Organization: Returns all dashboards within the tenant. This requires administrator privileges.

    Note: The -Filter parameter is only supported when -Scope is set to Organization.

    # Returns a dashboard named 'Contoso Sales' within the organization
    Get-PowerBIDashboard -Scope Organization -Name 'Contoso Sales'