Questions tagged [invoke-restmethod]
129 questions
0
votes
1 answer
Download a file from Azure git
I'm trying to download a file with the Azure Devops Rest API using Powershell's Invoke-RestMethod. It always seems to download from the main branch and ignores my branch specification
The urls I'm using are
invoke-restmethod -uri…

Peter Kronenberg
- 878
- 10
- 32
0
votes
2 answers
Powershell Invoke-RestMethod Paging
I am trying to get a list of all users from our Azure B2C tenant.
With some help from the internet I was able to create the powershell script below. But the result is incomplete it only shows 100 users. After searching around I found I should…

Gerald
- 23
- 3
- 7
0
votes
2 answers
Powershell ADP API Token
I am running the following in Powershell. I am getting an error returned that "The given client credentials were not valid". I am trying to do the first step of using the API, generating the access token. I have confirmed that I have a valid…

Kenny
- 3
- 2
0
votes
1 answer
Jira Rest Api in Powershell
Could you help me?
I am trying to create an issue in Jira using the Powershell Invoke-WebRequest cmdlet. And I am getting 400 Bad Request error.
I was able to send a successful request using Postman, so I made sure the body syntax is correct and I…

Aleksandr Filippov
- 63
- 3
- 10
0
votes
0 answers
Referencing data in JSON in Powershell via foreach
I'm accessing some JSON data using Invoke-RestMethod and I want to iterate through it, performing another Invoke-RestMethod per id and using the apiHost value for each call. A simplified example of the data is below:
"items": [
{
…

h0bn0b
- 15
- 1
- 2
0
votes
2 answers
Powershell - Invoke-RestMethod with multiple headers
I am trying to use Invoke-Restmethod in Powershell to call an API (I'm fairly new to this). I can get it to POST and return the jwt access token. I can also use that token to return an id via GET, however I'm then having trouble with the next step…

h0bn0b
- 15
- 1
- 2
0
votes
2 answers
Invoke-RestMethod PUT from remote computer results in Error 500 with Flask api
I recently deployed my first Flask app using IIS on Windows Server 2019 with wfastcgi.
I'm able to see the website on http:myServerIP:88/, log-in and everything else works. I'm also able to see some JSON data output when accessing some GET routes…

wk14
- 197
- 1
- 7
0
votes
0 answers
Complex queries with Invoke-RestMethod in Powershell
I am trying to invoke an API in Powershell with GET requests. I am familiar with filtering the response by sending a Powershell hashtable in the "Body" parameter as"
Invoke-RestMethod -Uri $uri -Body $filters -Headers $headers
But the hashtables…

Sanjiv Pradhanang
- 87
- 2
- 10
0
votes
1 answer
Making POST Request from PowerShell, JSON Parse Error From Powershell but Not Postman
I'm attempting to make a POST request to a local java spring application via PowerShell.
I load the request from a file, convert it to json, then attempt to Invoke-RestMethod.
$filePath = some/file/path.json
$string =…

Wickerbough
- 365
- 1
- 4
- 15
0
votes
0 answers
Weird behavior while invoking Rest call using Invoke-RestMethod on Powershell script
I want to pass body(parameters) to Rest-call using Invoke-RestMethod(powershell script) in GET call. but I think it's not supported because of some security reasons(some RFC standards).
But in single session, When I first use POST method and then if…

Manan
- 1
0
votes
0 answers
PSCustomObject with pages - page limit set to 25
I use Invoke-RestMethod to retrieve metadata about a bunch of documents in a folder via a REST API. While the method returns all the data in a PSCustomObject, I can't figure out how to access all of it. The custom object has the properties "page",…

Jan Kowalewski
- 15
- 3
0
votes
1 answer
How to pipe downloaded CSV data from Invoke-RestMethod to Import-CSV?
How can I represent, or at least view, this data?
PS /home/nicholas>
PS /home/nicholas> $labs='http://www.bccdc.ca/Health-Info-Site/Documents/BCCDC_COVID19_Dashboard_Lab_Information.csv'
PS /home/nicholas>
PS /home/nicholas>…

Nicholas Saunders
- 684
- 9
- 28
0
votes
1 answer
how to export raw XML returned from Invoke-RestRequest with Export-CliXml?
How can I get the curl result of just , from eXist, with PowerShell?
PS /home/nicholas>
PS /home/nicholas> $url='http://localhost:8080/exist/rest/db/scripts/notes.xq'
PS /home/nicholas>
PS /home/nicholas> $url …

Nicholas Saunders
- 684
- 9
- 28
0
votes
1 answer
How to convert a response from Invoke-RestMethod to JSON?
desired output:
nicholas@mordor:~$
nicholas@mordor:~$ lynx https://api.iocparser.com/url --dump
{"message": "The method is not allowed for the requested URL."}
nicholas@mordor:~$
doesn't have to be pretty.
current output:
PS /home/nicholas>
PS…

Nicholas Saunders
- 684
- 9
- 28
0
votes
1 answer
PowerShell Invoke-RestMethod Could not create TLS/SSL secure channel
I'm calling Invoke-RestMethod in a PowerShell script to upload a zip archive to an Artifactory repository.
I tested the script from my local machine PowerShell ISE; upload complete without issue as expected. However, when I execute the script on the…

The Furious Bear
- 592
- 4
- 16
- 31