Does powershell have an equivalent to the which command found in most (if not all) unix shells?

There are a number of times I'd like to know the location of something I'm running from the command line. In unix I just do which <command> and it tells me. I can't find an equivalent in Powershell.

link|improve this question

feedback

4 Answers

up vote 4 down vote accepted

This was asked and answered on Stack Overflow: Equivalent of *Nix ‘which’ command in Powershell?

link|improve this answer
Exactly what I was looking for. thanks! – Herms Sep 2 '09 at 19:17
feedback

Similar Powershell question was asked over at stackoverflow:

http://stackoverflow.com/questions/1362694/is-there-a-guide-to-the-somewhat-convoluted-powershell-syntax-example-with-biz/1362896#1362896

Some general guides linked to from that accepted answer:

link|improve this answer
feedback
function which([string]$cmd) {gcm -ErrorAction "SilentlyContinue" $cmd | ft Definition}
link|improve this answer
feedback

Also answered in 2008: Is there an equivalent of 'which' on windows?

Try the where command if you've installed a Resource Kit: http://ss64.com/nt/where.html

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.