【问题标题】:Installing windows features with chocolatey and packages.config使用 Chocolatey 和 packages.config 安装 Windows 功能
【发布时间】:2018-03-08 06:57:32
【问题描述】:

我想安装 Windows 功能列表,例如IIS-WebServerRole,使用 Chocolatey 保存在 packages.config 中。

列出可用的 Windows 功能给了我 ID....

choco list --source windowsFeatures
Chocolatey v0.10.8
Deployment Image Servicing and Management tool
Version: 10.0.14393.0
Image Version: 10.0.14393.0
Features listing for package : Microsoft-Windows-Foundation-Package~31bf3856ad364e35~amd64~~10.0.14393.0
----------------------------------------------------- | --------
Feature Name                                          | State
----------------------------------------------------- | --------
IIS-WebServerRole                                     | Enabled
IIS-WebServer                                         | Enabled
...

将这些 ID 放入 packages.config 并设置源属性:

<?xml version="1.0" encoding="utf-8"?>
  <packages>
    <package id="IIS-WebServerRole" source="windowsfeatures" />
    <package id="IIS-Security" source="windowsfeatures" />
    </packages>
</xml>

通过安装给我错误信息:

choco install .\packages.config --yes --acceptlicense
Chocolatey v0.10.8
Installing from config file:
.\packages.config
By installing you accept licenses for the packages.
Installing the following packages:
IIS-WebServerRole
IIS-Security
IIS-WebServerRole not installed. The package was not found with the source(s) listed.
 If you specified a particular version and are receiving this message, it is possible that the package name exists but the version does not.
 Version: ""
 Source(s): "windowsfeatures"
IIS-Security not installed. The package was not found with the source(s) listed.
 If you specified a particular version and are receiving this message, it is possible that the package name exists but the version does not.
 Version: ""
 Source(s): "windowsfeatures"

Chocolatey installed 0/2 packages. 2 packages failed.
 See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).

Failures
 - IIS-Security - IIS-Security not installed. The package was not found with the source(s) listed.
 If you specified a particular version and are receiving this message, it is possible that the package name exists but the version does not.
 Version: ""
 Source(s): "windowsfeatures"
 - IIS-WebServerRole - IIS-WebServerRole not installed. The package was not found with the source(s) listed.
 If you specified a particular version and are receiving this message, it is possible that the package name exists but the version does not.
 Version: ""
 Source(s): "windowsfeatures"

是否可以安装 package.config 中列出的 Windows 功能?

【问题讨论】:

    标签: chocolatey


    【解决方案1】:

    更新:

    该错误已得到解决,新版本 Chocolatey v0.11.3 已发布。

    原始答案:

    这应该是可能的,但是,这方面存在一个已知问题。

    这里正在跟踪:

    https://github.com/chocolatey/choco/issues/877

    我建议订阅该问题以获取有关更改的更新。

    【讨论】:

    • 根据此答案中链接的 Github 问题,修复此问题的承诺似乎已推送到 11.3
    • @BobSammers 感谢您对此的跟进。我已经用我们今天发布的新版本的信息更新了我的答案。
    【解决方案2】:

    默认情况下,chocolatey 在其数据中心搜索包裹。您正在尝试在此处启用 Windows 功能,而不是软件/应用程序。使用以下命令运行。

    choco install .\choco_iis.config --yes --acceptlicense -s windowsfeatures
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-12-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多