PowerShellでGrepっぽいこと
以下例とします。
あるフォルダ下すべての「.txt」ファイルのうち記載内容に「Get」を含むファイルとその行数を表示する
ただし、「Test.txt」は対象外とする
◇ コマンド
PS > dir -Recurse .\*.txt -Exclude "Test.txt" | Select-String "Get"
◇ 表示
Test1.txt:2:GetGoal
Test2.txt:3:Get-Command
以下例とします。
あるフォルダ下すべての「.txt」ファイルのうち記載内容に「Get」を含むファイルとその行数を表示する
ただし、「Test.txt」は対象外とする
◇ コマンド
PS > dir -Recurse .\*.txt -Exclude "Test.txt" | Select-String "Get"
◇ 表示
Test1.txt:2:GetGoal
Test2.txt:3:Get-Command