卷曲的窗户失败
问题描述:
我在unix中执行卷曲工作正常。窗口中的相同卷曲失败。卷曲的窗户失败
UNIX
curl -k --user admin:f1f82c270ec3ce28b4279809900fa00b -H "Jenkins-Crumb:3e7dc5a087ef7697f4a31d74fb99c4ac" -X POST https://jenkins-xyz/buildWithParameters?token=test\&release_version=2.1.0
Windows 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
答
你需要引用你的论点或使用PowerShell的命令行中使用的命令操作(&
)。它将您的&符解释为命令操作符。
& .\curl.exe -k --user admin:f1f82c270ec3ce28b4279809900fa00b -H "Jenkins-Crumb:3e7dc5a087ef7697f4a31d74fb99c4ac" -X POST https://jenkins-xyz/buildWithParameters?token=test\&release_version=2.1.0