I'm trying to run curl to upload a file in my script, using batch was painful because I need to do string manipulation etc so I turned to powershell.
However I can't seem to get powershell to execute Curl:
$hash = "test"
$fileToUpload = "hello world.txt"
$user = "user"
$password = "passy"
curl --ftp-create-dirs -T $fileToUpload -u ${user}:${pass} ftp://example.com/$hash/$fileToUpload
This results in:
Invoke-WebRequest : Parameter cannot be processed because the parameter name 'T' is ambiguous. Possible matches include:
-TimeoutSec -TransferEncoding.
At line:5 char:24
+ curl --ftp-create-dirs -T $fileToUpload -u ${user}:${pass} ftp://example.com/$ha ...
+ ~~
+ CategoryInfo : InvalidArgument: (:) [Invoke-WebRequest], ParameterBindingException
+ FullyQualifiedErrorId : AmbiguousParameter,Microsoft.PowerShell.Commands.InvokeWebRequestCommand
Curl.exe is in my PATH.