【发布时间】:2015-05-18 06:50:13
【问题描述】:
我正在 PowerShell 中编写一个脚本,它会显示一条长消息。基本上,我试图弄清楚如何将字符串分成多行,但它仍会显示为单行。
$paragraph = "This is a test to create a single-lined string,
but it doesn't seem to work. I would prefer
to make source code easier to read."
预期输出:
This is a test to create a single-lined string, but it doesn't seem to work. I would prefer to make source code easier to read.
实际输出:
This is a test to create a single-lined string.`
but it doesn't seem to work. I would prefer
to make source code easier to read.
我尝试过使用反引号,但这会产生相同的结果。有人知道格式化我的代码的正确方法吗?
【问题讨论】:
标签: powershell formatting