Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Jumpgate935
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? 

 

2 REPLIES 2
Jumpgate935
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.

 

v-yiruan-msft
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. 

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

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

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.