Questions tagged [invoke-webrequest]
256 questions
3
votes
1 answer
Rewrite CURL in PowerShell using Invoke-WebRequest with multiple certificates
I use the following curl command to publish some data from an IoT Thing to AWS's IoT Core service.
curl.exe --tlsv1.2 --cacert root-CA.pem --cert certificate.pem --key private.pem -X POST -d "$($Body)"…

Arbiter
- 450
- 5
- 26
2
votes
0 answers
Powershell - Subsequent Invoke-Webrequest extra slow
I am running into issues running subsequent invoke-webrequests.
Say I open the ISE for the first time and run the code below, I get the correct output in a few milliseconds.
Elapsed : 00:00:00.1780360
The See code below.
$timer =…

Marc Codere Dussault
- 21
- 2
2
votes
0 answers
Usage of Invoke-WebRequest, HttpClient Class and WebRequest Class
I am trying to send a Client-Certificate authenticated HTTPS-Request to a Web Server.
The only way I was able to get a "200" Response from this Server was with the following code using the Webrequest Class:
using namespace…

ABF
- 57
- 9
2
votes
2 answers
How can I access the raw request generated by Invoke-WebRequest in Powershell?
I have been tasked with writing a certain Powershell script into Go. I do not believe I am at liberty to share many of the details of what this script needs to do, except this: the script makes a call to an API using Invoke-WebRequest. The request…

Chris-AF
- 23
- 4
2
votes
1 answer
How to echo if invoke-webrequest failed due to an invalid/expired url else continue download in Powershell CLI?
I want to use a powershell command inside a batch file to download a file.
My code looks like that and works for just downloading the file from that specific url:
powershell "$progresspreference='silentlycontinue'; wget -uri…

leiseg
- 105
- 6
2
votes
1 answer
PowerShell ConvertTo-Xml vs [XML] Accelerator Type
I'm executing an HTTP Get request (via Invoke-WebRequest) against a website, that's in turn, is returning the following XML structure:

edwio
- 198
- 3
- 20
2
votes
1 answer
PowerShell, download the contents of a StackOverflow answer or comment
Each answer or comment on a StackOverflow question thread has a unique URL. How can we use that URL with Invoke-WebRequest (or other tool) to capture just the contents of that answer or comment in mini-Markdown, and from that, some useful…

YorSubs
- 3,194
- 7
- 37
- 60
2
votes
2 answers
PowerShell, Invoke-WebRequest for a url that is not pointing at a file, but initiates a file download
I can download the Google Chrome installer easily as follows:
Invoke-WebRequest "http://dl.google.com/chrome/install/latest/chrome_installer.exe" -OutFile "$env:Temp\chrome_installer.exe"
However, for Opera, I want specifically the latest 64-bit…

YorSubs
- 3,194
- 7
- 37
- 60
2
votes
1 answer
Powershell Invoke-WebRequest returns "please enable javascript"
I'm trying to do something like this to parse a homepage with a login page but Invoke-WebRequest doesn't return anything.
The page I'm trying to access is https://www.suidoapp.waterworks.metro.tokyo.lg.jp/#/login and the code I'm running is…

Tanaka Saito
- 943
- 1
- 17
- 40
2
votes
1 answer
Powershell ISE VSCODE Invoke-Webrequest difference
I am try to download the nuget.exe via Invoke-WebRequest inside a function.
If i use Windows Powershell ISE everything works fine.
$request = Invoke-WebRequest -Uri "https://dist.nuget.org/win-x86-commandline/latest/nuget.exe" -UseBasicParsing…

Carsten.R
- 128
- 9
2
votes
1 answer
invoke-WebRequest and a proxy that refuses to die in Powershell 5.1
I have a Windows Server 2019 instance that used to have a proxy server configured in its proxy setting but has since been disabled from Proxy Settings -> Proxy
If I run the powershell 5.1 command:
Invoke-WebRequest https://
then i'm still…

Chris D.
- 21
- 1
2
votes
0 answers
Getting wrongly encoded HTML response from Powershell Invoke-WebRequest
I am calling into an API endpoint with Invoke-WebRequest and the response headers are:
content-encoding: br
content-type: text/html; charset=UTF-8
What do I need to do for the invoke-webrequest response to not look like…

SKLAK
- 3,825
- 9
- 33
- 57
2
votes
0 answers
Invoke-WebRequest drop-in replacement for PowerShell 7 that uses System.Net.WebRequest
PowerShell 7's Invoke-WebRequest is much slower than PowerShell 5.1's. In some cases four-to-five times slower, as outlined in this issue. But even measuring the most basic web requests between the two, PowerShell 7's is at least twice as slow. This…

Vopel
- 662
- 6
- 11
2
votes
0 answers
tokenInvoke-WebRequest to site using Microsoft/Google OAuth
I need to access this main site https://www.truecaller.com/search/eg/xxxx via Powershell.
I wrote many PowerShell scripts to Invoke-WebRequest using forms authentication,
but this time the website is using external authentication from Google or…

Powershell Man
- 21
- 2
2
votes
1 answer
Save File out of return value from invoke-webrequest
I am trying to download a file from a website with powershell and save it in a C:\temp dir with it's original name
if i try Invoke-WebRequest -Uri ("uri to file download") -Method Get with the "-OutFile" Parameter i can save the file but not with…

ExeqZ
- 23
- 1
- 3