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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
sjrrkb123
Helper III
Helper III

How to overwrite existing .pbix files using the Export-PowerBIReport PowerShell command

I have a script that runs on Friday and exports all reports from a given workspace to ensure that we have backups incase a report builder deletes a report.

 

Currently, I have it dynamically creating the folder for that friday's date and then exports the reports into it. However, I am using OneDrive as the file location and would like to leverage its version control (file history) capabilities by just overwriting the existing .pbix files in the backup folder.

 

Here is a snippet of what I am using for the Export-PowerBIReport command:

 

$filepath = $filepath_first + "\RandomName.pbix" 
Export-PowerBIReport -Id $randompbix -OutFile $filepath

 

 

I have tried including the "-Force" command but keep getting the following error 
"A parameter cannot be found that matches parameter name 'Force'."

 

Here is a snippet of what I tried:

 

$filepath = $filepath_first + "\RandomName.pbix" 
Export-PowerBIReport -Id $randompbix -OutFile $filepath -Force

 

 

Any tips would be appreciated

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @sjrrkb123 

Please refer to this blog to export power bi report by Power Shell: 

PowerShell Scripts to Export Power BI Reports to PBIX/PDF/PPT

Please check the if PS "Run As Administrator" / or check if the FPE user (that installed the client) Run the PS window .

After that check again The cmdlets you used above.

 

Best Regards,

Rico Zhou

 

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

 

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi @sjrrkb123 

Please refer to this blog to export power bi report by Power Shell: 

PowerShell Scripts to Export Power BI Reports to PBIX/PDF/PPT

Please check the if PS "Run As Administrator" / or check if the FPE user (that installed the client) Run the PS window .

After that check again The cmdlets you used above.

 

Best Regards,

Rico Zhou

 

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

 

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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