I am able to use Select-String to return a list of files that contain some text that i am looking for:
Get-ChildItem *.cs -recurse | Select-String -SimpleMatch ".ToList()" | group path | select name
What I am trying to do is apply subsequent filters to the result of my query. I would like to do something like:
if($fileSet -eq $null)
{
$fileSet = Get-ChildItem *.cs -recurse | Select-String -SimpleMatch ".ToList()" | group path | select name
}
$fileSet | Select-String -SimpleMatch "Additional Term" | group path | select name
I think i need a way to pipe the contents of an array of files ($fileSet) to Select-String; however I'm pretty sure I going about this all wrong. Any help appreciated!