Windows powershell中的卷曲格式

Windows powershell中的卷曲格式,windows,powershell,unix,curl,Windows,Powershell,Unix,Curl,我有一个curl,它在linux系统上运行得非常好。我只是用一些参数远程触发Jenkins作业 但是,Windows中的相同命令会出错 curl.exe -k --user abc:xyz -X POST https://myjenkins.com/job/abc/buildWithParameters??token=deploy\&release_version=2.3.1.0-5-auto2\&docker_registry=10.0.0.12:8083\&vcmts

我有一个curl,它在linux系统上运行得非常好。我只是用一些参数远程触发Jenkins作业

但是,Windows中的相同命令会出错

curl.exe -k --user abc:xyz -X POST https://myjenkins.com/job/abc/buildWithParameters??token=deploy\&release_version=2.3.1.0-5-auto2\&docker_registry=10.0.0.12:8083\&vcmts_build=vcmts_pi07
错误如下:

    At line:1 char:260
+ ... ??token=deploy\&release_version=2.3.1.0-5-auto2\&docker_registry=96.118.23.36:80 ...
+                    ~
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.
At line:1 char:293
+ ... .3.1.0-5-auto2\&docker_registry=10.0.0.12:8083\&vcmts_build=vcmts_pi07
+                    ~
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.
At line:1 char:328
+ ... 0.0.12:8083\&vcmts_build=vcmts_pi07
+                    ~
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

要避免这个问题,我应该做哪些格式更改?

将参数用单引号括起来,单引号不像双引号字符串那样展开

curl -k --user 'abc:xyz' -X POST 'https://myjenkins.com/job/abc/buildWithParameters?token=deploy&release_version=2.3.1.0-5-auto2&docker_registry=10.0.0.12:8083&vcmts_build=vcmts_pi07'

我假设将帖子URL用引号括起来:
POST“https:…vcmts_pi07”
。否则,单引号为:
POST'https:…vcmts\u pi07'