-
Notifications
You must be signed in to change notification settings - Fork 191
MS PowerBI Rest error: Invoke-RestMethod : The 'Content-Type' header must be modified #5
Comments
I am getting a similar error:
|
I was getting the same error and these updates made my code work: and I believe the sample code mixes long and short dashes which was giving me an error as well so here is the modified code for that: |
Thanks so much. I will have a look. Nancy. |
Hi, I had the same issue and got an error with BrightKnight6 code too, but adding single quotes around Authorization and Content seemed to do the trick. So the key difference between the original and this is Content instead of Content-Type. I'm a newbie to all the concepts here so can't really explain why. This is what I ended up with: $authHeader = @{ Scott |
I consistently receive the error below and my dataset does not refresh, any help would be appreciated.
VERBOSE: GET https://api.powerbi.com/v1.0/myorg/datasets/$datasetId/refreshes with 0-byte payload |
HI All, I am also getting :
I tried all changes mentioned above but nothing worked. Please help |
I'm also getting similar error: Invoke-RestMethod : A positional parameter cannot be found that accepts argument 'â€Headers System.Collections.Hashtable â€Method'.
|
In issue Azure-Samples#5, it's pointed out in Azure-Samples#5 (comment) that the Invoke-RestMethod parameter names have long dashes, which causes problems. This changes the en dashes to dashes, which fixed the error.
You need to save you code to file that is not UTC. More than likely you copied code from a webpage and it include special characters that need to be removed. You can always delete the problem line and retype it manually. |
+1 Tried all suggestions and nothing worked. @nickodemis99 The file was download via git, not a web browser |
Hi,
I have PowerBI setup with a gateway and have been able to refresh the datasource using the MS tools.
I have customized the ps1 program with my company's settings and have installed the PowerShell tools.
When I run the manageRefresh.ps1 command, I get the errors:
Any ideas? Thanks in advance for looking. Nancy.
The text was updated successfully, but these errors were encountered: