我正在尝试运行curl来在我的脚本中上传文件,使用批处理很痛苦因为我需要进行字符串操作等所以我转向Power
Shell.
但是我似乎无法使用powershell来执行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
这导致:
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在我的PATH中.