1

I am trying to upload a single file via curl from within a gitlab-shell-runner.

Basically I need to use this command:

curl --user <user:password> --insecure --upload-file <file> https://example.com

Following error is shown:

 Invoke-WebRequest : A positional parameter cannot be found that accepts argument "<user:password>"

Which adjustments do I need to make, to run this inside gitlab-ci?

I have already tried to use a variable for the address and different variation of quotations.

Thank you in Advance!

J-T
  • 65
  • 8

1 Answers1

0

As mentioned in "Running cURL on 64 bit Windows" you are running a CmdLet called Invoke-WebRequest, which has a curl alias in Powershell.
Start by removing it:

Remove-item alias:curl

Then check if your script does call the actual curl command (or you might need to call it explicitly).

Or: use Invoke-WebRequest (aliased 'curl') with a Basic $encodedCredentials header.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250