I’m not so hot with PowerShell yet, but have managed to get this command to work quite nicely:
get-childitem "C:\Code\WC1" -Recurse | select-string "insert into\s+my_table"
Thing is, I know I’m going to struggle to remember this, so how can I make it into a function where the path supplied to get-childitem and the search regex are parameters?
I’m using PowerShell 2.0.
You can put this in your PowerShell Profile.
An easy way to do this is to edit the
$profilefile (run something likenotepad $profilefrom your PowerShell prompt) and just paste the text right in.