Suggestion: new-alias "which" "get-command"

Aug 24, 2007 at 7:25 PM
I am coming from unix bash and I find myself typing the which command a lot. Getting an error confuses me (since it makes me think the command I asked for does not exist, not the which alias), so it might be a good idea to add that alias to pscx by default :)

It helps a lot when exploring powershell (or pscx) :)

Aug 30, 2007 at 3:28 PM
I've already got such an alias in my own profile.ps1. I'd vote +1 to this request.
Sep 9, 2007 at 10:55 PM
Isn't it shorter to type "gcm"? I can understand the desire to create an alias to a common Unix utility to ease the transition. Let's see how many other folks chime in.
Sep 12, 2007 at 5:31 PM
I'd vote +1 too. I tried which ages ago, and only recently discovered the existence of get-command
Sep 15, 2007 at 7:04 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.
Sep 15, 2007 at 7:06 PM
Sep 17, 2007 at 11:42 PM
Of course it is shorter to type gcm, but for that you first have to know that it exists :) Reading alias lists (or manuals) is not my preferred way of learning new software. Okay, something like this might help to learn new aliases:

function whereis($cmd) {
if (test-path Alias:$cmd) {
whereis (get-childitem Alias:$cmd).Definition
} else {
get-alias | ? {$_.Definition -eq $cmd}

"whereis which" will tell you that there is gcm :)