I am looking for a way to automate a manual task. I'm not sure if it's even possible.
I have to find a pattern of string in all files in a project folder. It'a project of C#/.net project(if that matters at all). I have to also write the function name and file name where the pattern occurs, along with the full string that matches it. So far I've done following in PowerShell:
PS C:\trunk> Get-ChildItem "C:\trunk” -recurse | Select-String -pattern
“AlertMessage” | group path | select name
This prints file name where string pattern matches.
PS C:\trunk> Select-String -pattern "AlertMessage" -path
"C:\trunk\VATScan.Web\Areas \Administration\Controllers\HomeController.cs”
This prints line number and string that matches it in a given file.
Any pointers on how I can acheive my goal?