Quantcast
Channel: What is Windows' equivalent of the "which" command in Unix? Is there an equivalent PowerShell command? - Super User
Viewing all articles
Browse latest Browse all 7

Answer by user10404 for What is Windows' equivalent of the "which" command in Unix? Is there an equivalent PowerShell command?

$
0
0

Yes, Get-Command will find all commands including executables:

PS\> Get-Command ipconfig

If you want to limit the commands to just executables:

PS\> Get-Command -CommandType Application

Will find all exes in your path. There is an alias for interactive use:

PS\> gcm net* -CommandType Application

To get the path of an executable, you can use the Path property of the returned object. For example:

PS\> (Get-Command notepad.exe).Path

For more info, run man Get-Command -full.


Viewing all articles
Browse latest Browse all 7

Trending Articles