Windows / Powershell version of the Unix 'which' Utility [duplicate] Windows / Powershell version of the Unix 'which' Utility [duplicate] windows windows

Windows / Powershell version of the Unix 'which' Utility [duplicate]


You can use Get-Command <command>, or shorten it to gcm.


where does the same on recent versions of Windows. If you're after a PowerShell command, Novakov's answer is correct.


On Windows from Command Prompt (cmd)

cmd> where <command>

In Powershell (PS)

ps> get-command <command>ps> where.exe <command>

You can also add alias to the 'which' command in PS

ps> New-Alias which get-command

and now you can use 'which' command like usual

ps> which <command>