相当于 PowerShell 中的 *Nix 'which' 命令? [英] Equivalent of *Nix 'which' command in PowerShell?

查看:39
本文介绍了相当于 PowerShell 中的 *Nix 'which' 命令?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何询问 PowerShell 某物在哪里?

How do I ask PowerShell where something is?

例如,which notepad",它根据当前路径返回运行notepad.exe的目录.

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

推荐答案

当我开始在 PowerShell 中自定义我的配置文件时,我创建的第一个别名是which".

The very first alias I made once I started customizing my profile in PowerShell was 'which'.

New-Alias which get-command

要将其添加到您的个人资料中,请键入:

To add this to your profile, type this:

"`nNew-Alias which get-command" | add-content $profile

最后一行开头的 `n 是为了确保它会作为一个新行开始.

The `n at the start of the last line is to ensure it will start as a new line.

这篇关于相当于 PowerShell 中的 *Nix 'which' 命令?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆