Azure devops - GIT - 命令行与 PowerShell 任务 - %2 正在从命令行任务中的 URL 中删除,但在 PS 中工作

Azure devops - GIT - Command Line vs PowerShell Task - %2 is getting removed from the URL in command line task but works in PS

当我在 ADO 构建管道中使用 PS 任务但在命令行任务中同样失败时,使用以下方法有效。

git push https://PAT@dev.azure.com/MyORG/Work%20Management/_git/Work%20Mgmt%20-%20ME

命令行任务中显示失败:

##[error]remote: TF200016: The following project does not exist: Work0Management. Verify that the name of the project is correct and that the project exists on the specified Azure DevOps Server.
fatal: repository 'https://dev.azure.com/MyORG/Work0Management/_git/Work0Mgmt0-0ME/' not found

似乎 %2 正在从 URL 中删除。

我尝试使用 @'URL' 但失败并显示致命错误:不支持协议 '@'https' 错误。

我们应该更喜欢 PS 而不是 ADO 中的命令行任务吗?注意:在使用 PS 时,我们现有的构建代理几乎没有其他问题,因此我计划将 CML 任务用​​于 git 活动。

%20 的出现更改为 %%20。命令 shell 将 %2 解释为空参数。剩下 0.