首页 > 解决方案 > 如何在PowerShell中使用管道输入

问题描述

我正在尝试使用通过管道传输到命令中的输入对象,如下所示:

gci C:\Users\user\ | where name -match "txt" | notepad.exe $_.name

但是,这并没有按预期工作,我知道 BASH 必须-将上一个命令的输出放入下一个命令。我如何在powershell中做同样的事情?还是我缺少另一种方法?还有一种方法可以解释空格/等吗?

标签: powershellpipe

解决方案


推荐阅读