Home > front end >  Getting Path information out of an alias in Powershell
Getting Path information out of an alias in Powershell

Time:10-04

If I try to lookup vi on my machine it gives me this:

❯ get-command vi

CommandType     Name                                               Version    Source
-----------     ----                                               -------    ------
Alias           vi -> vim.exe

However, vim.exe isn't on the PATH. The alias does, however, work, so I feel like there's more information on the alias that would provide more information. How do I obtain the path to vim.exe from the alias?

CodePudding user response:

#1st resolve the alias

$cmdInfo = get-command vi

#2nd get the command info, add fl* to list all properties

get-command $cmdInfo.ReferencedCommand | fl *
  • Related