小编krm*_*l87的帖子

保留缓冲区的 Powershell Clear-Host 替代方案

我想要像 Clear-Host 这样的东西,但想要回滚。

到目前为止,我所拥有的基本上是添加换行符,直到屏幕清晰。虽然当我这样做时,光标开始在页面底部书写(正如预期的那样 - 虽然不是需要的)。

我希望从页面顶部开始写作(对于菜单等——这是很自然的事情)

这是打印新行动态计数的代码:

do {Write-Host ""; $i++}
while ($i -ne $Host.UI.RawUI.WindowSize.Height)
Run Code Online (Sandbox Code Playgroud)

我确实看到了一些关于 Transcript 模块的内容,但不希望看到。

提前致谢。

windows powershell buffer newline

5
推荐指数
1
解决办法
1470
查看次数

标签 统计

buffer ×1

newline ×1

powershell ×1

windows ×1