Skip to content

Unable to Connect with Power BI Service using PowerShell  #68

@Dhruvinshah16

Description

@Dhruvinshah16

I have installed PowerShell for Power BI using following Code.
Install-Module -Name MicrosoftPowerBIMgmt
It is installed successfully.
2018-08-08_9-55-31
Now, I used following code-snippet to connect with Power BI Service.
Login-PowerBI
When I executed the code it shows me an error like:
Login-PowerBI : The 'Login-PowerBI' command was found in the module 'MicrosoftPowerBIMgmt.Profile', but the module could not be loaded. For more information, run 'Import-Module MicrosoftPowerBIMgmt.Profile'. At line:1 char:1 + Login-PowerBI`

+ ~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Login-PowerBISmiley Frustratedtring) [], CommandNotFoundException
    + FullyQualifiedErrorId : CouldNotAutoloadMatchingModule`
![screenshot_4](https://user-images.githubusercontent.com/41663430/43937993-d5198450-9c7e-11e8-95ff-562315ef29f3.png)
I have also tried to import  module MicrosoftPowerBIMgmt.Profile using following code:

`Import-Module MicrosoftPowerBIMgmt.Profile`

It shows me following error:

Import-Module : Could not load file or assembly 'netstandard, Version=2.0.0.0, Culture=neutral, 
PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. Reference assemblies should not be loaded for 
execution.  They can only be loaded in the Reflection-only loader context. (Exception from HRESULT: 0x80131058)
At line:1 char:1
+ Import-Module MicrosoftPowerBIMgmt.Profile
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (Smiley Happy [Import-Module], BadImageFormatException
    + FullyQualifiedErrorId : System.BadImageFormatException,Microsoft.PowerShell.Commands.ImportModuleCommand

Below is a screenshot for the same.
untitled

Same Question is posted here as well.
https://community.powerbi.com/t5/Developer/Unable-to-Connect-with-Power-BI-Service-using-PowerShell/m-p/484963#M14886

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions