As the title says, an easy way to find out the path of a program/command on Windows using PowerShell can be done with
For example, I want to find out where I had installed
nvim (Neovim) on a rarely use Windows machine. To do this, I can execute the following command:
❯ Gt-Command nvim CommandType Name Version Source ----------- ---- ------- ------ Application nvim.exe 0.0.0.0 C:\Program Files\Neovim\bin\nvim.exe
With PowerShell, we can also just print a specific attribute (?) of an object.
❯ (Get-Comand nvim).Path C:\Program Files\Neovim\bin\nvim.exem
You can read more about this here.
As a bonus, here is another way to list the path of a program:
❯ where.exe nvim C:\Program Files\Neovim\bin\nvim.exe