Forum Discussion
(PowerShell) Connect-PowerBIServiceAccount not working
- 4 years ago
Problem found and solved!
It turned out that an update to the PowerShell extension for VS Code set this value "powershell.useX86Host": true. In other words, it started running 32 bit as default. Manually changing it back to x64 like shown in the screenshots belov solved the problem:
Cheers, Mike
I was just about to raise the ticket, and I checked the version of the MicrosoftPowerBIMgmt package. Mine was 1.0.896, while the latest is 1.2.1026:
https://www.powershellgallery.com/packages/MicrosoftPowerBIMgmt/1.2.1026
So I updated the module and all dependent modules:
MicrosoftPowerBIMgmt.Admin (>= 1.2.1026)
MicrosoftPowerBIMgmt.Capacities (>= 1.2.1026)
MicrosoftPowerBIMgmt.Data (>= 1.2.1026)
MicrosoftPowerBIMgmt.Profile (>= 1.2.1026)
MicrosoftPowerBIMgmt.Reports (>= 1.2.1026)
MicrosoftPowerBIMgmt.Workspaces (>= 1.2.1026)
and the problem has gone! Hope this will work for you too!
Thank you for the feedback. I have tried this solution, but unfortunately it did not solve the problem. May I ask what dev tools you are using? I am using VS code with powershell 5.1 for development.
- alexgor875 years agoAdvocate II
I was running the commands from the standard Windows PowerShell terminal (5.1) as administrator. I also have VS Code, but I don't use very complex scripts so there's nothing much to develop at the moment.
- h4tt3n5 years agoHelper V
This is interesting: The script runs fine in the PowerShell ISE editor, but it won't run in VS code. IF you are having problems, try updating the MicrosoftPowerBIMgmt module with the command:
Install-Module MicrosoftPowerBIMgmt -force -AllowClobber
and then run the script in either PS command line tool or ISE. This has worked for me.
However, since VS code is a superior toll over cmd or ISE, and sinc it is a Microsoft product, I am holding my support ticket open.- carloscantu4 years agoAdvocate III
This fixed the issue for me, thank you for sharing!