Commands › Power BI

Invoke-PowerBIRestMethod

Power BI MicrosoftPowerBIMgmt Invoke-*

Executes a REST call to the Power BI service, with the specified URL and body.

Quick start script

# Invoke-PowerBIRestMethod — quick start (serv365.ai)
# 1. Connect (app-only shown; interactive: omit the certificate parameters)
Connect-PowerBIServiceAccount -ServicePrincipal -CertificateThumbprint $thumb -ApplicationId $appId -Tenant $tenantId

# 2. Run and inspect
Invoke-PowerBIRestMethod -Method <PowerBIWebRequestMethod> -Url <String> | Format-List

# 3. Export for evidence / drift tracking
Invoke-PowerBIRestMethod | Export-Clixml .\PowerBIRestMethod-$(Get-Date -Format yyyyMMdd).xml

Syntax

Invoke-PowerBIRestMethod -Url <String> -Method <PowerBIWebRequestMethod> [-Body <String>] [-OutFile <String>]
 [-ContentType <String>] [-Headers <Hashtable>] [-TimeoutSec <Int32>] [-Organization <String>]
 [-Version <String>] [<CommonParameters>]

Parameters (9)

ParameterTypeRequiredWhat it controls
-Body String Body of the request, also known as *content*. This is optional unless the request method is POST, PUT, or PATCH.
-ContentType String Content type to specify inside the header for the request. Default is 'application/json'.
-Headers Hashtable Optional headers to include with the request.
-Method PowerBIWebRequestMethod yes Type of HTTP request method\verb to make with the call.
-Organization String Organization name or tenant GUID to include in the URL. Default is 'myorg'.
-OutFile String Output file for writing the response content to. File path specified must not exist.
-TimeoutSec Int32 Specifies how long the request can be pending before it times out. Enter a value in seconds. Entering a value of 0 specifies an indefinite time-out.
-Url String yes Relative or absolute URL of the Power BI entity you want to access. For example, if you want to access https://api.powerbi.com/v1.0/myorg/groups, then specify 'groups', or pass in the entire URL.
-Version String Version of the API to include in the URL. Default is 'v1.0'. Ignored if -Url is an absolute URL.

Reference facts derived from Microsoft documentation, © Microsoft, licensed MIT; restructured with original guidance by serv365.ai.