0

是否有一些非荒谬的(foreach)方法可以用 powershell 重现 linux 输出?

回声 A{0..9} A0 A1 A2 A3 A4 A5 A6 A7 A8 A9


写主机 A(0..9) A 0 1 2 3 4 5 6 7 8 9

谢谢!

4

1 回答 1

1

我不认为这是荒谬的:

# If you want them on different lines
(0..9) | % {"A$_"} | Write-Host

# If you want them on the same line
(0..9) | % {"A$_ "} | Write-Host -NoNewline
于 2019-10-03T14:41:25.993 回答