Commits

Kevin Berridge committed 6c6312c

enhanced grep and psglass

Comments (0)

Files changed (1)

Microsoft.PowerShell_profile.ps1

 
 function dw { get-childitem $args | format-wide }
 
-function grep ([string]$arg, [string]$filter="") {
-  dir -r -filter $filter | select-string $arg
+function grep {
+<#
+.SYNOPSIS
+  Searches for matches in files
+.DESCRIPTION
+  grep forsomething -path .\subfolder -filter *.cs
+#>
+  param(
+    [Parameter(Position=0, Mandatory=1)]
+    [string]$pattern, 
+    [string]$path='.', 
+    [string]$filter=$null
+  )
+  dir -r -path $path -filter $filter | select-string $pattern
 }
 
 function ff([string] $filter) { dir -r -filter $filter }
 
   $psakeParams = @{ taskList = $taskList; docs = $docs; parameters = $parameters; properties = $properties }
 
-  $psakeDir = $nil
-  if (Test-Path '.\Libraries\psake') { $psakeDir = '.\Libraries\psake' }
+  if (Test-Path '..\vendor\psake') { $psakeDir = '..\vendor\psake' }
+  elseif (Test-Path '.\vendor\psake') { $psakeDir = '.\vendor\psake' }
+  elseif (Test-Path '.\Libraries\psake') { $psakeDir = '.\Libraries\psake' }
   elseif (Test-Path '..\Libraries\psake') { $psakeDir = '..\Libraries\psake' }
   
   if ($psakeDir) {