Created
April 4, 2012 21:14
-
-
Save ferventcoder/2305721 to your computer and use it in GitHub Desktop.
Somebody's where.exe implementation as powershell ;)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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 } } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Ok, give my fork a shot... :)