Skip to content

Instantly share code, notes, and snippets.

@ferventcoder
Created April 4, 2012 21:14
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ferventcoder/2305721 to your computer and use it in GitHub Desktop.
Save ferventcoder/2305721 to your computer and use it in GitHub Desktop.
Somebody's where.exe implementation as powershell ;)
$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 } }
@staxmanade
Copy link

I wasn't ready to see this go public yet ( was like 10 min of hacking )... It's buggy and meh - ENJOY :)

@ferventcoder
Copy link
Author

Can you edit it? I shared it with no one...so it's more hiding in the open than public

@staxmanade
Copy link

Ok, give my fork a shot... :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment