无法将多行字符串设置为环境变量 [英] Can not set multi line string to environment variable

查看:34
本文介绍了无法将多行字符串设置为环境变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在 VSTS powershell 任务中将多行字符串设置为环境变量.以下代码只保存字符串的第一行.

How can I set multi line string to environment variable on VSTS powershell task. Following code only save the first line of the string.

[string]$xmlstring = Get-Content -Encoding UTF8 -Path"$(System.DefaultWorkingDirectory)/apiPolicy.xml" -Raw |外串;写主机(##vso[task.setvariable variable=policystring;]"+$xmlstring)

推荐答案

不支持 build 或 release 中的多行变量,因此在 build/release 时也不能设置多行变量.

Multiple lines variable in build or release is not supported, so it can’t be set the multiple variable during the build/release too.

相关用户声音:构建和发布中的多行变量.

使用 base64 字符串是个好方法.

To do it with the base64 string is the good way.

这篇关于无法将多行字符串设置为环境变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆