Forum Discussion
Rohitb
2 years agoHelper 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 ?
- 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}")