Equivalent of *Nix 'which' command in PowerShell?

后端 未结 14 2204
刺人心
刺人心 2020-11-28 00:16

How do I ask PowerShell where something is?

For instance, \"which notepad\" and it returns the directory where the notepad.exe is run from according to the current

14条回答
  •  南方客
    南方客 (楼主)
    2020-11-28 00:49

    Check this PowerShell Which.

    The code provided there suggests this:

    ($Env:Path).Split(";") | Get-ChildItem -filter notepad.exe
    

提交回复
热议问题