Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New-Object : Cannot find an overload for "PlatformParameters" and the argument count: "1". #60

Open
collinsmc23 opened this issue Jul 8, 2019 · 2 comments

Comments

@collinsmc23
Copy link

Just stumbled on the PowerBIPS module this morning. I am trying to shape the script in a customized way which fits my situation within PowerBi. I have been sitting here for hours trying to figure out this error message:

New-Object : Cannot find an overload for "PlatformParameters" and the argument count: "1".

Whenever I try to execute the below command or just simply calling Get-PBIAuthToken, my error gets flagged.

$data | Out-PowerBI -authToken $authToken -dataSetName "CSVSales" -tableName "Sales" it

@jujiro
Copy link

jujiro commented Nov 22, 2019

Same here.

PS C:\temp> Get-PBIAuthToken -clientId "C0E8435C-614D-49BF-A758-3EF858F8901B"
New-Object : Cannot find an overload for "PlatformParameters" and the argument count: "1".
At C:\Program Files\WindowsPowerShell\Modules\PowerBIPS\2.0.3.2\PowerBIPS.psm1:307 char:16

  • ... pltParams = New-Object Microsoft.IdentityModel.Clients.ActiveDirector ...
  •             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (:) [New-Object], MethodException
    • FullyQualifiedErrorId : ConstructorInvokedThrowException,Microsoft.PowerShell.Commands.NewObjectCommand

Cannot get the access token, AcquireTokenAsync returned null
At C:\Program Files\WindowsPowerShell\Modules\PowerBIPS\2.0.3.2\PowerBIPS.psm1:314 char:9

  •     throw "Cannot get the access token, AcquireTokenAsync returne ...
    
  •     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : OperationStopped: (Cannot get the ...c returned null:String) [], RuntimeException
    • FullyQualifiedErrorId : Cannot get the access token, AcquireTokenAsync returned null

@JeffWRush
Copy link

I'm encountering this error as well. What is the resolution or workaround? Do I need to replace the version of Microsoft.IdentityModel.Clients.ActiveDirectory.dll used?

2020-07-21T15:48:19Z [Error] ERROR: New-Object : Cannot find an overload for "PlatformParameters" and the argument count: "1".
At D:\home\site\wwwroot\HttpTrigger1\Modules\powerbips.2.0.4.2\PowerBIPS.psm1:309 char:16

  • ... pltParams = New-Object Microsoft.IdentityModel.Clients.ActiveDirector ...
  •             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
  • CategoryInfo : InvalidOperation: (:) [New-Object], MethodException
  • FullyQualifiedErrorId : ConstructorInvokedThrowException,Microsoft.PowerShell.Commands.NewObjectCommand

Script stack trace:
at Get-PBIAuthToken, D:\home\site\wwwroot\HttpTrigger1\Modules\powerbips.2.0.4.2\PowerBIPS.psm1: line 309
at , D:\home\site\wwwroot\HttpTrigger1\run.ps1: line 16

System.Management.Automation.MethodException: Cannot find an overload for "PlatformParameters" and the argument count: "1".
at System.Management.Automation.Adapter.GetBestMethodAndArguments(String methodName, MethodInformation[] methods, PSMethodInvocationConstraints invocationConstraints, Object[] arguments, Object[]& newArguments)
at System.Management.Automation.DotNetAdapter.ConstructorInvokeDotNet(Type type, ConstructorInfo[] constructors, Object[] arguments)
at Microsoft.PowerShell.Commands.NewObjectCommand.CallConstructor(Type type, ConstructorInfo[] constructors, Object[] args)

2020-07-21T15:48:19Z [Error] EXCEPTION: Cannot get the access token, AcquireTokenAsync returned null
At D:\home\site\wwwroot\HttpTrigger1\Modules\powerbips.2.0.4.2\PowerBIPS.psm1:316 char:9

  •     throw "Cannot get the access token, AcquireTokenAsync returne ...
    
  •     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
  • CategoryInfo : OperationStopped: (Cannot get the acce\u2026Async returned null:String) [], RuntimeException
  • FullyQualifiedErrorId : Cannot get the access token, AcquireTokenAsync returned null

Script stack trace:
at Get-PBIAuthToken, D:\home\site\wwwroot\HttpTrigger1\Modules\powerbips.2.0.4.2\PowerBIPS.psm1: line 316
at , D:\home\site\wwwroot\HttpTrigger1\run.ps1: line 16

System.Management.Automation.RuntimeException: Cannot get the access token, AcquireTokenAsync returned null

2020-07-21T15:48:20Z [Error]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants