Examples/DeployPbix.ps1
Import-Module PowerBIManager #Enable writing informational messages $InformationPreference = "Continue" #Connect to the Power BI service, pass a ClientId theat has acces to your tennant #if credentials are not specified it will use an existing session or prompt for your credentials Connect-PBI -ClientId "d57ac8af-1019-431d-8fed-5fd8db180388" #select the Workspace you want to upload to, skip this for your personal workspace Use-PBIGroup "ManagementInfo" #create a data structure for search/replace server names in connections $cr = @( @{"CurrentServer"="MyDevServer\TabularInstance"; "NewServer"="Mydomain.MyTopDomain.MyProdServer\TabularInstance" } @{"CurrentServer"="Mydomain.MyTopDomain.MyDevServer\TabularInstance"; "NewServer"="Mydomain.MyTopDomain.MyProdServer\TabularInstance" } ) #upload all pbix files in local directory, altering the datasource to replace development server with production server Get-ChildItem C:\Temp\PBIX -Filter "*.pbix" | Import-PBIContent -ConnectionReplacement $cr |