azure-devops - Reusing PowerShell Scripts in Azure DevOps
问题描述
I have a PowerShell script that I want to re-use across multiple build pipelines. My question is, is there a way I can "store" or "save" my PowerShell script at the project or organization scope so that I can use it in my other build pipelines? If so, how? I can't seem to find a way to do this. It would be super handy though.
解决方案
根据这些脚本的大小,您可以创建包含 powershell 任务的任务组,其中脚本为 inline-powershell。但这仅适用于项目范围..
我尝试的另一种尝试是创建一个包含您的 powershell 脚本的存储库,将此存储库作为子模块添加到您尝试构建的存储库中,然后从子模块文件夹中调用脚本。但这仅在使用 git-repos 时有效。
或者您可以创建一个包含您的脚本的自定义构建任务。
推荐阅读
- amazon-web-services - Promise.all(promiseList) 不工作,但 Promise.all(promiseList[0]) 是
- php - 为所有 laravel 社交名流请求添加自定义标头
- python - 从未在烧瓶中设置的站点获取 Cookie
- html - 您可以使用 mailto 链接回复电子邮件并保留线程吗?
- reactjs - 使用 useSelector 钩子测试反应组件
- asp.net - 如何将 OnRowCommand 分配给多个 ID ASP.net 和 VB.net 后端
- python - Python打开TIF失败多个库
- shell - Autosys 文件观察程序文件正则表达式
- c# - 在 Xamarin.Forms 跨平台应用程序中使用 Amazon Cognito 用户池进行身份验证
- javascript - 我怎样才能使这个javascript代码更短?