小编Dil*_*ili的帖子

Powershell:更新当前输出线

有没有办法在powershell中更新命令输出的当前行?

我知道怎么写到同一行:

Write-Host "hello " -NoNewLine

Write-Host "world!" -NoNewLine

但是有没有办法完成当前的线路更换?就像是:

Write-Host "hello "
Write-Host "world!" -ReplaceLine
Run Code Online (Sandbox Code Playgroud)

提前致谢!


解:

Write-Host "hello " -NoNewLine
Write-Host "`rworld!"
Run Code Online (Sandbox Code Playgroud)

powershell command-line output

8
推荐指数
1
解决办法
2万
查看次数

标签 统计

command-line ×1

output ×1

powershell ×1