简体   繁体   English

通过 PowerShell DSC 和 choco 部署 VS19

[英]Deploy VS19 over PowerShell DSC and choco

My goal is to deploy TeamCity agents configuration in Azure with DSC extensions.我的目标是使用 DSC 扩展在 Azure 中部署 TeamCity 代理配置。 I'm able to deploy all required apps and services but I can't find how to deploy Visual Studio 19 with its optional parameters.我能够部署所有必需的应用程序和服务,但我找不到如何使用其可选参数部署 Visual Studio 19。 VS19 itself installed, except parameters with Workload ID's, SDK's, etc. which I'm sending in the DSC build. VS19 本身已安装,但我在 DSC 构建中发送的带有工作负载 ID、SDK 等的参数除外。

I'm using member Params for sending optional parameters.我正在使用成员参数来发送可选参数。 Perhaps I'm doing something wrong, can somebody, please take a look and help me with this issue?也许我做错了什么,有人可以看看并帮助我解决这个问题吗? Thanks!谢谢!

cChocoPackageInstaller vs19
{
    Name      = "visualstudio2019enterprise"
    Ensure    = "Present"
    Params    = "--add Microsoft.VisualStudio.Workload.Azure;includeRecommended `
                 --add Microsoft.NetCore.Component.DevelopmentTools;includeRecommended `
                 --add Microsoft.VisualStudio.Workload.Data;includeRecommended `
                 --add Microsoft.VisualStudio.Workload.NetCoreTools;includeRecommended `
                 --add Microsoft.VisualStudio.Workload.ManagedDesktop;includeRecommended `
                 --add Microsoft.Net.Component.4.6.1.SDK `
                 --add Microsoft.Net.Component.4.6.2.SDK `
                 --add Microsoft.Net.Component.4.7.1.SDK `
                 --add Microsoft.Net.Component.4.7.2.SDK `
                 --add Microsoft.Net.Component.4.7.2.SDK `
                 --add Microsoft.Net.Component.4.7.SDK `
                 --add Microsoft.Net.Core.Component.SDK.2.2"
    DependsOn = "[cChocoInstaller]installChoco"
}

The Params parameter is for package parameters . Params参数用于包参数 The visualstudio2019enterprise lists the package parameters that can be used on the package page (and links to more of them here ). visualstudio2019enterprise列出了可以在包页面上使用的包参数(并在此处链接到更多参数)。

I think what you are looking for are installer parameters (ie. --install-arguments ) that can be passed to the installer (if its supported by the installer).我认为您正在寻找的是可以传递给安装程序的安装程序参数(即--install-arguments )(如果安装程序支持)。 If this is the case you could try using chocoParams = "--install-arguments='<your stuff>'" and see if that works (disclaimer - I haven't tested it).如果是这种情况,您可以尝试使用chocoParams = "--install-arguments='<your stuff>'"并查看是否有效(免责声明 - 我还没有测试过)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM