【发布时间】:2019-11-15 17:43:47
【问题描述】:
我们如何在 PowerShell 中使文本居中? WindowWidth 显然不存在,所以有没有办法让文本居中?
我们想要这个输出:
*
***
*****
*******
所以我写了
for ($i=1; $i -le 7; $i+=2)
{
write-host("*" * $i)
}
但是我们得到了
*
***
*****
*******
【问题讨论】:
-
你需要空白
-
我们不能将“blanks”合并到for循环中吗?
-
查看
$host自动变量。
标签: powershell