Find file
Fetching contributors…
Cannot retrieve contributors at this time
3 lines (3 sloc) 409 Bytes
$local:command_usage = "usage: find-string filename-pattern text-to-find"
if ($args.length -lt 2) { return ($command_usage) }
get-childitem -r -i $args[0] | select-string $args[1] | group-object Path | select-object @{Expression={ $_.Name.Substring((get-location).Path.Length + 1) }; Name="Filename" }, @{Expression={ $_.Group | foreach-object { $_.LineNumber} }; Name="Line Numbers"} | format-table -Autosize