Azure-Samples / powerbi-powershell

Samples for calling the Power BI REST API via PowerShell
MIT License
260 stars 191 forks source link

How to Fix Invoke Issue! #15

Open bpark1994 opened 6 years ago

bpark1994 commented 6 years ago

Hey guys,

After struggling for a few hours trying to get this script to work I realized the problem I was having was that when you copy the script from GitHub some of the dashes are double dashes and need to be changed to single dashes. Such a stupid thing but it eluded me for a bit.

So wherever you see the "Invoke-RestMethod" you will notice that before the Headers and before Method there is a double dash which needs to be changed to a single dash. Highlighted in bold below.

Invoke-RestMethod -Uri $uri Headers $auth_header Method POST -Body $body

I just did a replace all and it ran smoothly after that!

Also sorry for opening a new issue just didn't feel like commenting on everyone's issue since multiple people have been posting this.