Skip to content

Instantly share code, notes, and snippets.

@serbrech
Created March 9, 2012 12:13
Show Gist options
  • Save serbrech/2006265 to your computer and use it in GitHub Desktop.
Save serbrech/2006265 to your computer and use it in GitHub Desktop.
powershell whereis first draft
function get-path{
$env:path -split';'
}
function whereis
{
$argument = $cmd, [string]$arguments = $args;
foreach ($item in get-path){
foreach ($thing in gci $item -ErrorAction silentlycontinue){
if($thing.Name.StartsWith($cmd + ".")){
echo $item;
}
}
}
}
@serbrech
Copy link
Author

serbrech commented Mar 9, 2012

it's not 100%, but was good enough to find what I wanted. will maybe consider improving it...

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