PowerShell: how to grep command output?

前端 未结 7 1337
温柔的废话
温柔的废话 2021-01-30 08:27

In PowerShell I have tried:

alias | select-string Alias

This fails even though Alias is clearly in the output. I know this is beca

7条回答
  •  北恋
    北恋 (楼主)
    2021-01-30 08:54

    I think this solution is easier and better, use directly the function findstr:

    alias | findstr -i Write
    

    You can also make an alias to use grep word:

    new-alias grep findstr
    

提交回复
热议问题