Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
7 | |
7 | |
3 | |
2 | |
2 |
User | Count |
---|---|
6 | |
5 | |
4 | |
4 | |
4 |