Showing results for 
Search instead for 
Did you mean: 
Frequent Visitor

PowerShell scripting to tell difference between RDL and PBIX in Power BI service

I have a PowerShell script using the Get-PowerBIWorkspace, Get-PowerBIReport, and Export-PowerBIReport cmdlets to retrieve the report files from our Power BI service workspaces.   We recently went to premium capacity, and now we have pagianted report content some of our workspaces.  In our case, the RDL and PBIX files in the workspace are named with the same name.


My current export script is finding the two items named the same (one paginated report and the other a Power BI report), but it doesn't handle identification of the file I am looking at as RDL or PBIX content.  (My script to this point has assumed that it would only see PBIX files and writes the files out with that extension.)   The effect of my script exporting the workspace is that the first extraction is overwritten by the second, since I am just reading out the exported file contents and appending the PBIX file extension to it.  


I didn't see anyway in the return data from the PowerShell cmdlets I'm using to determine what kind of report content I am accessing - RDL or PBIX.  Is there a type value or some value I can evaluate to filter my powershell command to find only the RDL content? 


Frequent Visitor

Thank you for your input - I've added a Power BI Idea for that enhancement here: Microsoft Idea · Extend the PowerShell scripts Get-PowerBIReport and Export-PowerBIReport to identif... . Vote it up!


So given that I can't identify the file with an attribute in those PowerShell scripts, does anyone have a tidy way in PowerShell to examine the file I've downloaded to deternine if it is a PBIX or RDL file?  I'm assuming the content of the files would tell me if I knew what I was looking for in them and the best way to script that examination.


Community Support
Community Support

Hi @Jumpgate935 ,

According to the syntax of cmdlets Get-PowerBIReport, I did not find any parameter to identify the report type. Please check this documentation for details. You can raise a new idea and add your comments there to make this feature coming sooner. 

   [-Scope <PowerBIUserScope>]
   [-Filter <String>]
   [-First <Int32>]
   [-Skip <Int32>]
   [-WorkspaceId <Guid>]

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

April Update

Check it Out!

Click here to read more about the April 2021 Updates!


The largest Power BI virtual conference

100+ sessions, 100+ speakers, Product managers, MVPs, and experts. All about Power BI. Attend online or watch the recordings.


Experience what’s next for Power BI

See the latest Power BI innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Top Solution Authors
Top Kudoed Authors