PowerShell FINDSTR eqivalent?

后端 未结 8 953
栀梦
栀梦 2021-02-02 09:28

What\'s the DOS FINDSTR equivalent for PowerShell? I need to search a bunch of log files for \"ERROR\".

8条回答
  •  别那么骄傲
    2021-02-02 09:53

    This is not the best way to do this:

    gci  -filter *.csv | where { $_.OpenText().ReadToEnd().Contains("|") -eq $true }
    

    This helped me find all csv files which had the | character in them.

提交回复
热议问题