Velvet Star Monitor

Standout celebrity highlights with iconic style.

general

What are the Powershell options for the curl included in Windows Server 2016?

Writer Matthew Barrera

I was just able to successfully download a file using the curl included in win server 2016 with the commandline:
curl URL -o file.mp4
But commands like curl -V and curl --help fail.
Are these the wrong parameters for curl within Powershell?
If so what is the correct commandline for curl --help within Powershell.

Note: I don't have access to CMD.

1

2 Answers

If your version of Windows includes the actual curl binary (as versus the alias that PowerShell has by default), you'll find it in C:\Windows\system32\curl.EXE . It may be at a slightly different path depending upon your Windows, "which curl" typed into a Powershell window will return the exact path. Otherwise you are out of luck.

In powershell curl is actually an alias for another command Invoke-WebRequest. If you want to use curl you need to provide the path to it and run it with the arguments provided. It's now installed with windows.

$CURLEXE = 'c:\Windows\System32\curl.exe'
$userIDPass = 'yourusername:yourpassword'
$baseURI = '
$curlScanArguments = "-u", "$userIDPass", '-X', 'POST', "$baseURI/resources/jobs/loads", '-H', 'accept: application/json', '-H', 'Content-Type: application/json', '--data', '{ \"resourceName\": \"NAME\"}'
& $CURLEXE @curlArguments

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy