Azure DevOps Hosted Agents - Add Tool (PS Module) to agent

眉间皱痕 提交于 2019-12-02 08:35:14

问题


I am wondering if there is an easy way to incorporate an extra tool to one of the default Microsoft hosted agent pools (specifically VS2017). Basically, I want to add some of the extra ARM powershell modules that are not installed by default as only the core set of modules are installed; i.e. I am looking to leverage some of the extra modules such as AAD as part of the deplyment pipeline, e.g. to create an AAD role definition.

I guess the same would be true for CLI extensions if I was using the CLI instead of PS.

Essentially, I am wondering if I have to use my own agent on a self hosted agent pool (my own VMs) or if I can just add the extra modules to the microsoft hosted agent pool VMs as part of the deployment pipeline, perhaps as a task?


回答1:


For PowerShell modules, you can just use Install-Module in an inline script (or at the start of your existing scripts) to ensure they're installed. That, of course, assumes the modules are in the PowerShell Gallery.

Worst case, just put the modules you need in source control and publish them as an artifact along with everything else so you can load them up.



来源:https://stackoverflow.com/questions/53383789/azure-devops-hosted-agents-add-tool-ps-module-to-agent

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!