【发布时间】:2021-09-16 21:09:57
【问题描述】:
我正在尝试通过 jenkins 运行 powershell 脚本。但在传递多行字符串时遇到问题。
$content = @"
test1
test2
test3
"@
Add-content filepath $content
上面的脚本是通过 jenkins 运行的,但是内容被保存在一行中。例如
test1test2test3
但我想以下面的方式保存它-
test1
test2
test3
任何解决方案我怎样才能将内容保存在上面提到的不同行中。
【问题讨论】:
-
这似乎是目标文件的编码问题...
标签: powershell jenkins jenkins-plugins powershell-2.0 powershell-3.0