az 管道嵌入式与号 (&) 在传递键=值时中断



如何传递一个包含与号(&(和其他字符的值。以下powershell脚本使失败

$groupname = "owtest"
$tags = @()
$key="test"
$value="some=&this&that"
$tags += "$key=$value"
$creation = az pipelines variable-group create --name $groupname --variables $tags --only-show-errors

是否有一种变通方法可以允许插入"与"one_answers"与"字符?

在我的测试中,我们必须对包含&或其他字符的值使用双引号(单引号

az pipelines variable-group create --name $groupname --variables test="some=&this&that" ...

如果你想使用上面的格式($tags += "$key=$value"(,你需要使用$value="""some=&this&that"""而不是$value="some=&this&that"

最新更新