Skip to content

Instantly share code, notes, and snippets.

@ferventcoder
Created April 4, 2012 21:14
Show Gist options
  • Select an option

  • Save ferventcoder/2305721 to your computer and use it in GitHub Desktop.

Select an option

Save ferventcoder/2305721 to your computer and use it in GitHub Desktop.

Revisions

  1. ferventcoder created this gist Apr 4, 2012.
    2 changes: 2 additions & 0 deletions Where.ps1
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,2 @@
    $exe = 'git';
    if($exe.EndsWith('.exe') -or $exe.EndsWith('.bat')) { $exe = $exe.Substring(0, $exe.Length - 4)}; (ls env:\path).Value.split(';') | %{ if( test-path "$_\$exe.exe" ) { ls "$_\$exe.exe" }; if( test-path "$_\$exe.bat" ) { ls "$_\$exe.bat" }; } | %{ if($_.FullName.EndsWith('.exe') -or $_.FullName.EndsWith('.bat')) { $_.FullName } }