How did you get Curl to work in Windows? My guess is a Pearl Bash hack. Okay so here is what I found in the past doing this. When you use Curl with Windows Powershell, it doesn't really know how to handle the contents.
Example:
When you make an API call, like "get all machine id's", you might get a list of 100 values. Usually, you would do something like 'Grep' for the name you need, then you pass the 'id' value to a variable and use that to affect the target.
What I found happening was the string of 'text' wasn't being passed as a string object, but rather some sort of machine type object. In a nutshell, you end up having to transform the data, then you have to figure out how to search it. It gets yucky really fast.
Solution:
Invoke-WebRequest
While this module takes a little getting use to, when you use it you can pass the values as Powershell Rich Objects and use the $variable.value sort of syntax that everyone loves with Powershell.
https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/invoke-webrequest?view=powershell-7.1
#chat_id variable creation. This might need to be in the header, I don't know this API but wanted to show the example
$body = @{
chat_id = 333333
text = yooo
}
#Example. Actual code may vary.
$message = @{Invoke-RestMethod "https://api.telegram.org/ `
- Headers @{Authorization = "bot0000 xxxxx"} `
- Body $body `
- Method Get }
#now we can use $message to see what's available.
#we can then use $message.whatever to view the responses.