2017-06-20 12 views
2

うまく動作するカールをUNIXで実行します。同じカールは窓で失敗します。 Windowsでウィンドウのカールに失敗する

UNIX

curl -k --user admin:f1f82c270ec3ce28b4279809900fa00b -H "Jenkins-Crumb:3e7dc5a087ef7697f4a31d74fb99c4ac" -X POST https://jenkins-xyz/buildWithParameters?token=test\&release_version=2.1.0 

あなたの引数を引用またはPowerShellののコマンドラインでコマンド演算子(&)を使用する必要があり

PS D:\Softwares\curl> curl.exe -k --user admin:f1f82c270ec3ce28b4279809900fa00b -H "Jenkins-Crumb:3e7dc5a087ef7697f4a31d 
74fb99c4ac" -X POST https://jenkins-xyz/buildWithParameters?token=test\&release_version=2.1.0 
At line:1 char:226 
+ ... ers?token=test\&release_version=2.1.0 
+     ~ 
The ampersand (&) character is not allowed. The & operator is reserved for future use; wrap an ampersand in double 
quotation marks ("&") to pass it as part of a string. 
    + CategoryInfo   : ParserError: (:) [], ParentContainsErrorRecordException 
    + FullyQualifiedErrorId : AmpersandNotAllowed 

答えて

0

以下と同じことエラーを出しPowerShellの。アンパサンドをコマンド演算子として解釈しています。

& .\curl.exe -k --user admin:f1f82c270ec3ce28b4279809900fa00b -H "Jenkins-Crumb:3e7dc5a087ef7697f4a31d74fb99c4ac" -X POST https://jenkins-xyz/buildWithParameters?token=test\&release_version=2.1.0 

powershell-and-external-commands-done-right

関連する問題