因此,我一直在關注這個問題,一直在扯掉我的頭髮。我有一個curl命令,我正在從Cloudflare中取出日誌的Windows計算機上工作,這是有效的。命令在cmd提示符下工作,但不在Powershell中,我做錯了什麼?
curl -sv -o logname.log.gz -X GET -H "Accept-encoding: gzip" -H "X-Auth-Email: [email protected]" -H "X-Auth-Key: 12345" "https://api.cloudflare.com/client/v4/zones/987654/logs/requests?start=1481509909&end=1481538709"
我試圖與製作基於當前時間不同的開始和結束時間參數的最終目標導入到PowerShell的這一點,但是我根本無法得到命令在PowerShell中運行,我已經嘗試了各種不同的曲目,這是最新和最簡單的。
cmd.exe /c 'curl -sv -o logname.log.gz -X GET -H "Accept-encoding: gzip" -H "X-Auth-Email: [email protected]" -H "X-Auth-Key: 12345" "https://api.cloudflare.com/client/v4/zones/987654/logs/requests?start=1481509909&end=1481538709"'
這給了我這個錯誤
{ [11971 bytes data]
* Failed writing body (0 != 11963)
* Failed writing data
* Curl_http_done: called premature == 1
* Closing connection 0
* schannel: shutting down SSL/TLS connection with api.cloudflare.com port 443
* schannel: clear security context handle
我已經知道我的UNIX時間是有點過,並計劃於固定,明年,但我不明白的是,爲什麼同樣的命令工作通過命令提示而不是通過Powershell。
會有人能幫助?
謝謝
不能使用單引號'CMD/C '...''爲'cmd'只支持雙引號,像'CMD/C 「......」'。 – aschipfl