windows - PowerShell 命令的程序路径在哪里?

标签 windows git powershell

命令“git”可从 PowerShell 获得,我想知道 git 安装在我的 PC 上的哪个位置,所以我尝试执行这样的“脚本”

PS> where git

但执行后我什么也没看到,只提示输入新命令。
问题:如何在 Windows 10 中找到命令的路径?

最佳答案

在 Powershell 中, where where-object 的别名,用于过滤集合。

Get-Alias -Name where                                                                
CommandType     Name                          Version    Source
-----------     ----                          -------    ------
Alias           where -> Where-Object

在 Cmd 中,where 显示文件的位置。

Cmd 的 where 的 Powershell 版本是 Get-Command
Get-Command -Name git
CommandType     Name                        Version    Source
-----------     ----                        -------    ------
Application     git.exe                     2.20.1.1   C:\Program Files\Git\cmd\git.exe

关于windows - PowerShell 命令的程序路径在哪里?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62270559/

相关文章:

c++ - 线性大小增加有时最终会增加 1

c++ - 在 Windows 上使用重叠命名管道进行同时读写

java - 从批处理文件显示错误对话框

c# - 给定 shell 扩展 CLSID,如何找到实现 COM 可执行文件或 DLL,并检查其接口(interface)和成员?

c# - 在 C# 中导入 PowerShell 模块

c - 有没有办法获取 .exe 中包含的静态链接函数并重用它们?

windows - Powershell 删除配置文件脚本 - 错误检查不起作用

android - 如何在 git 中不包含带有 API 字符串的类文件,但仍然在构建服务器上获取它?

linux - 不能硬链接(hard link) gitconfig 文件

git - 为什么 git pull merge 是默认行为?