Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi,
Anyone see what is wrong with the below in Windows PowerShell ISE?
It works with -Method Post but not Put. Testing overwriting the data every 12 seconds.
while (1 -eq 1 ){
$command=
$data = Invoke-RestMethod -Method Get "https://api.xxxxxxxxxx"
$endpoint = "https://api.powerbi.com/beta/xxxxxxxxxxxxxxx/datasets/xxxxxxxxxxx/rows?experience=power-bi&key=xxxxxxxxxxxxxxxxx"
$payload = @{
"ticker" =$data."ticker"
"v" =$data."results"."v"
"vw" =$data."results"."vw"
"o" =$data."results"."o"
"c" =$data."results"."c"
"h" =$data."results"."h"
"l" =$data."results"."l"
"t" =$data."results"."t"
"n" =$data."results"."n"
}
Invoke-RestMethod -Method Put -Uri "$endpoint" -Body (ConvertTo-Json @($payload))
$command
start-sleep -seconds 12
}
Returns:
Invoke-RestMethod : The remote server returned an error: (404) Not Found.
At C:\Users\xxxxx\OneDrive - xxxxx\Desktop\API stock test.ps1:17 char:1
+ Invoke-RestMethod -Method Put -Uri "$endpoint" -Body (ConvertTo-Json ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException
+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand
That's working as designed. Were you expecting a different behavior?
BTW you are missing the table name.
Push Datasets - Datasets PostRows - REST API (Power BI Power BI REST APIs) | Microsoft Learn
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
Check out the November 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 4 | |
| 3 | |
| 2 | |
| 1 | |
| 1 |
| User | Count |
|---|---|
| 11 | |
| 10 | |
| 4 | |
| 3 | |
| 3 |