windows Chocolatey的安装路径在哪里?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/28235388/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-08 18:56:52  来源:igfitidea点击:

Where is the Chocolatey installation path?

windowspowershellchocolatey

提问by Gary Ewan Park

I am looking to find out the current Chocolatey installation path using PowerShell.

我正在寻找使用 PowerShell 找出当前 Chocolatey 安装路径。

回答by Gary Ewan Park

There is an environment variable set on installation, ChocolateyInstall, which is set to C:\Chocolateyby default in versions of Chocolatey less than 0.9.8.27. After that, this defaults to C:\ProgramData\Chocolatey.

安装时设置了一个环境变量 ,在低于 0.9.8.27 的 Chocolatey 版本中默认ChocolateyInstall设置为C:\Chocolatey。之后,这默认为C:\ProgramData\Chocolatey.

NOTE:By default, the C:\ProgramDatafolder on Windows is hidden. You will either need to enable hidden files and folders through Folder Options | Viewor you can navigate directly to the path shown above by copy/pasting directly into the Windows Explorer address bar.

注意:默认情况下,C:\ProgramDataWindows 上的文件夹是隐藏的。您将需要启用隐藏文件和文件夹,Folder Options | View或者您可以通过直接复制/粘贴到 Windows 资源管理器地址栏中来直接导航到上面显示的路径。

In version 0.9.9 of Chocolatey, it actively moves from the old folder location to the new one.

在 Chocolatey 0.9.9 版本中,它主动从旧文件夹位置移动到新文件夹位置。

You can also pre-emptively create this environment variable before installing Chocolatey to control where it gets installed if required.

如果需要,您还可以在安装 Chocolatey 之前预先创建此环境变量以控制它的安装位置。

回答by wallybh

When you install Chocolatey they add the Chocolatey /binpath to your path variable.

当您安装 Chocolatey 时,他们会将 Chocolatey/bin路径添加到您的路径变量中。

In PowerShell:

在 PowerShell 中:

$env:Path