Ready to get started?

Download a free trial of the Power BI XMLA Data Provider to get started:

 Download Now

Learn more:

Power BI XMLA Icon Power BI XMLA ADO.NET Provider

Rapidly create and deploy powerful .NET applications that integrate with Power BI XMLA.

Automate Power BI XMLA Integration Tasks from PowerShell



Are you in search of a quick and easy way to access Power BI XMLA data from PowerShell? This article demonstrates how to utilize the Power BI XMLA Cmdlets for tasks like connecting to Power BI XMLA data, automating operations, downloading data, and more.

The CData ADO.NET Provider for Power BI XMLA is a standard ADO.NET Provider that make it easy to accomplish data cleansing, normalization, backup, and other integration tasks by enabling real-time access to Power BI XMLA.

ADO.NET Provider

The ADO.NET Provider provides a SQL interface for Power BI XMLA; this tutorial shows how to use the Provider to retrieve Power BI XMLA data.

Once you have acquired the necessary connection properties, accessing Power BI XMLA data in PowerShell can be enabled in three steps.

By default, use Azure AD to connect to Microsoft Power BI XMLA. Azure AD is Microsoft’s multi-tenant, cloud-based directory and identity management service. It is user-based authentication that requires that you set AuthScheme to AzureAD.

For more information on other authentication schemes, refer to the Help documentation.

  1. Load the provider's assembly:

    [Reflection.Assembly]::LoadFile("C:\Program Files\CData\CData ADO.NET Provider for Power BI XMLA\lib\System.Data.CData.PowerBIXMLA.dll")
  2. Connect to Power BI XMLA:

    $conn= New-Object System.Data.CData.PowerBIXMLA.PowerBIXMLAConnection("AuthScheme=AzureADInitiateOAuth=GETANDREFRESH") $conn.Open()
  3. Instantiate the PowerBIXMLADataAdapter, execute an SQL query, and output the results:

    $sql="SELECT Country, Education from Customer" $da= New-Object System.Data.CData.PowerBIXMLA.PowerBIXMLADataAdapter($sql, $conn) $dt= New-Object System.Data.DataTable $da.Fill($dt) $dt.Rows | foreach { Write-Host $_.country $_.education }