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 September 15. Request your voucher.

Reply
Rohitb
Helper I
Helper I

Open "PowerBI" Desktop using PowerShell

Hello,

I have a requirement where I have to open PowerBI Desktop Application via PowerShell & also open a PBIX File using PowerShell.

Can someone help me with this ?

2 ACCEPTED SOLUTIONS
Anonymous
Not applicable

Hi @Rohitb ,

 

At my knowledge, we can get path of the .pbix file and open power bi desktop with the .pbix file using powershell.

 

Sample:

$PowerBIFilePath = "C:\*** "

Start-Process -FilePath $PowerBIFilePath

 

Best Regards,

Wearsky

View solution in original post

This PowerShell code opens your Power BI and then saves your PBIX file as a PBIT.
You need to change lines two and three in this code according to your path.

ahadkarimi_1-1723396066882.png

 


ahadkarimi_2-1723396348173.png

 


Add-Type -AssemblyName System.Windows.Forms
$powerBIPath = "C:\Program Files\Microsoft Power BI Desktop RS\bin\PBIDesktop.exe"
$filePath = "C:\Users\Ahadk\OneDrive\Desktop\Working.pbix"

Start-Process $powerBIPath -ArgumentList $filePath
Start-Sleep -Seconds 30
[System.Windows.Forms.SendKeys]::SendWait('%')
Start-Sleep -Seconds 1
[System.Windows.Forms.SendKeys]::SendWait('F')
Start-Sleep -Seconds 1
[System.Windows.Forms.SendKeys]::SendWait('{ENTER}')
Start-Sleep -Seconds 1
[System.Windows.Forms.SendKeys]::SendWait('{DOWN}')
Start-Sleep -Seconds 0.5
[System.Windows.Forms.SendKeys]::SendWait('{DOWN}')
Start-Sleep -Seconds 1
[System.Windows.Forms.SendKeys]::SendWait('{ENTER}')
Start-Sleep -Seconds 1
[System.Windows.Forms.SendKeys]::SendWait('{ENTER}')
Start-Sleep -Seconds 2
[System.Windows.Forms.SendKeys]::SendWait("{TAB}")
Start-Sleep -Seconds 1
[System.Windows.Forms.SendKeys]::SendWait('{DOWN}')
Start-Sleep -Seconds 1
[System.Windows.Forms.SendKeys]::SendWait('{DOWN}')
Start-Sleep -Seconds 1
[System.Windows.Forms.SendKeys]::SendWait("{TAB}")
Start-Sleep -Seconds 1
[System.Windows.Forms.SendKeys]::SendWait("{ENTER}")

View solution in original post

8 REPLIES 8
ahadkarimi
Solution Specialist
Solution Specialist

Open PowerShell:

ahadkarimi_0-1723388404350.png

Place PBIDesktop file path between double quotes, like this:

Start-Process -FilePath "C:\Program Files\Microsoft Power BI Desktop RS\bin\PBIDesktop.exe"

ahadkarimi_4-1723388791727.png

 

ahadkarimi_1-1723388431787.png

for PBIX files:
Place your file path between double quotes, like this:

Start-Process -FilePath "C:\Users\Ahadk\OneDrive\Desktop\test.pbix"

ahadkarimi_3-1723388569010.png

 

 

Hey @ahadkarimi 

Opening the pbix was already stated by @Anonymous . 

The next ask from the user is to save the opened file as another format. 

 




----------------------------------------------------------------------------------------------
Nandan Hegde (MSFT Data MVP)
LinkedIn Profile : www.linkedin.com/in/nandan-hegde-4a195a66
GitHUB Profile : https://github.com/NandanHegde15
Twitter Profile : @nandan_hegde15
MSFT MVP Profile : https://mvp.microsoft.com/en-US/MVP/profile/8977819f-95fb-ed11-8f6d-000d3a560942
Topmate : https://topmate.io/nandan_hegde
Blog :https://datasharkx.wordpress.com

This PowerShell code opens your Power BI and then saves your PBIX file as a PBIT.
You need to change lines two and three in this code according to your path.

ahadkarimi_1-1723396066882.png

 


ahadkarimi_2-1723396348173.png

 


Add-Type -AssemblyName System.Windows.Forms
$powerBIPath = "C:\Program Files\Microsoft Power BI Desktop RS\bin\PBIDesktop.exe"
$filePath = "C:\Users\Ahadk\OneDrive\Desktop\Working.pbix"

Start-Process $powerBIPath -ArgumentList $filePath
Start-Sleep -Seconds 30
[System.Windows.Forms.SendKeys]::SendWait('%')
Start-Sleep -Seconds 1
[System.Windows.Forms.SendKeys]::SendWait('F')
Start-Sleep -Seconds 1
[System.Windows.Forms.SendKeys]::SendWait('{ENTER}')
Start-Sleep -Seconds 1
[System.Windows.Forms.SendKeys]::SendWait('{DOWN}')
Start-Sleep -Seconds 0.5
[System.Windows.Forms.SendKeys]::SendWait('{DOWN}')
Start-Sleep -Seconds 1
[System.Windows.Forms.SendKeys]::SendWait('{ENTER}')
Start-Sleep -Seconds 1
[System.Windows.Forms.SendKeys]::SendWait('{ENTER}')
Start-Sleep -Seconds 2
[System.Windows.Forms.SendKeys]::SendWait("{TAB}")
Start-Sleep -Seconds 1
[System.Windows.Forms.SendKeys]::SendWait('{DOWN}')
Start-Sleep -Seconds 1
[System.Windows.Forms.SendKeys]::SendWait('{DOWN}')
Start-Sleep -Seconds 1
[System.Windows.Forms.SendKeys]::SendWait("{TAB}")
Start-Sleep -Seconds 1
[System.Windows.Forms.SendKeys]::SendWait("{ENTER}")
Anonymous
Not applicable

Hi @Rohitb ,

 

At my knowledge, we can get path of the .pbix file and open power bi desktop with the .pbix file using powershell.

 

Sample:

$PowerBIFilePath = "C:\*** "

Start-Process -FilePath $PowerBIFilePath

 

Best Regards,

Wearsky

Thankyou for your response @Anonymous .

How do I save the PowerBI File as PBIT/PBIP using PowerShell ?

Anonymous
Not applicable

Hi @Rohitb ,

 

I'm afraid that this requirement cannot be easily implemented with PowerShell. This may require programming experience with PowerShell and .NET. As a simple workaround, please try Power Automate Desktop.

Sample:

vxiaocliumsft_0-1722922456789.png

vxiaocliumsft_0-1722922490157.png

You can record your operation steps, such as saving, etc…

 

Best Regards,

Wearsky

@Anonymous  Thankyou for your response.

I have already explored Power Automate way but we want to explore via PowerShell/Python/.Net

Can you please help with either of the 3 coding language ?

I am not sure whether this is even possible because based on MSFT documentation; the only was is for it to be done manually




----------------------------------------------------------------------------------------------
Nandan Hegde (MSFT Data MVP)
LinkedIn Profile : www.linkedin.com/in/nandan-hegde-4a195a66
GitHUB Profile : https://github.com/NandanHegde15
Twitter Profile : @nandan_hegde15
MSFT MVP Profile : https://mvp.microsoft.com/en-US/MVP/profile/8977819f-95fb-ed11-8f6d-000d3a560942
Topmate : https://topmate.io/nandan_hegde
Blog :https://datasharkx.wordpress.com

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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