各种。
>哪里是直接的等价物?
C:\Users\Joey>where cmd C:\Windows\System32\cmd.exe
请注意,在PowerShell中,它本身是Where-Object的别名,因此您需要在PowerShell中使用where.exe。
>在cmd中,您还可以使用:
C:\Users\Joey>for %x in (powershell.exe) do @echo %~$PATH:x C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
>在PowerShell中,您有Get-Command及其别名gcm,如果传递参数(但也可用于PowerShell中的别名,cmdlet和函数),则执行相同操作:
PS C:\Users\Joey> Get-Command where CommandType Name DeFinition ----------- ---- ---------- Alias where Where-Object Application where.exe C:\Windows\system32\where.exe
第一个返回的命令是将被执行的命令。