Forum Discussion
Open "PowerBI" Desktop using PowerShell
- Anonymous2 years ago
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 $PowerBIFilePathBest Regards,
Wearsky
- 2 years agoThis 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.
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 $filePathStart-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}")
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 ?
- Anonymous2 years agoNot 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:
You can record your operation steps, such as saving, etc…
Best Regards,
Wearsky
- Rohitb2 years agoHelper I
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 ?- NandanHegde2 years agoSuper User
I am not sure whether this is even possible because based on MSFT documentation; the only was is for it to be done manually