Here’s a wonderful little tool called grep in Linux. It’s crazy easy to use.
% grep 'search string' filename
And here’s an example:
% grep 'Html.ActionLink' *.cshtml
And it works exactly the way you would expect it to work. Run this from the root of an MVC project, and you’ll find all of the links in your application.
Here’s the equivalent line in PowerShell.
> Get-ChildItem .\* -include *.cshtml -recurse | Select-String -pattern "Html.ActionLink"
I love that we have a solid scripting option available in Windows now. I love that we can really build some great stuff with PowerShell. But really, are there any PS development authors out there who actually use this stuff in a real work environment? I suppose it’s not really so different from the rest of the Microsoft story.