小编Rav*_*rma的帖子

使用powershell在文本文件中找到特定行后如何停止Get-Content -wait?按需退出管道

我在 Powershell 中使用以下脚本(版本为 5.1):

Get-Content -Path path\to\text\file\to\be\read.txt -Wait
Run Code Online (Sandbox Code Playgroud)

现在,即使文件没有更新,它也会继续读取。在文本文件中找到特定行后如何停止?有没有其他方法可以阻止这种情况?

powershell pipeline break powershell-5.0

3
推荐指数
2
解决办法
2155
查看次数

标签 统计

break ×1

pipeline ×1

powershell ×1

powershell-5.0 ×1