在Mac上安装的VSTS代理中运行Powershell构建步骤? [英] Run powershell build step in VSTS agent installed on mac?

查看:72
本文介绍了在Mac上安装的VSTS代理中运行Powershell构建步骤?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Mac上安装了VSTS build agent来构建xamarin iOS项目.在我添加powershell构建步骤之前,构建工作正常. 即使我为Mac安装了Powershell( https://github.com/PowerShell/PowerShell )并重新-安装了代理,VSTS抱怨说它没有能够运行该构建的代理.

I installed VSTS build agent on mac to build xamarin iOS project. Builds worked fine until I added powershell build step. Even though I installed powershell for mac (https://github.com/PowerShell/PowerShell) and re-installed the agent, VSTS complains it does not have agent that is capable to run the build.

找不到具有以下功能的代理: DotNetFramework,Xamarin.iOS,npm

No agent could be found with the following capabilities: DotNetFramework, Xamarin.iOS, npm

当我禁用构建步骤时,构建工作就可以了.

When I disable the build step, builds work just fine.

是否可以在Mac上运行powershell构建步骤?

Is it possible to run powershell build step on Mac?

推荐答案

正如MrHinsh所言,PowerShell任务不能在Mac上使用.

As MrHinsh clarified, the PowerShell task cannot be used on Mac.

作为解决方法,我使用了ShellScript任务:

As a workaround I used ShellScript task:

使用以下bash脚本:

With the following bash script:

#!/bin/bash
powershell ./SetAppVersion.ps1

此外,powershell安装程序似乎并未将powershell添加到我的PATH中,因此我不得不添加它:

Also, the powershell installer did not seem to add powershell to my PATH so I had to add it:

$ export PATH=$PATH:/usr/local/microsoft/powershell/6.0.0-alpha.16

这篇关于在Mac上安装的VSTS代理中运行Powershell构建步骤?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆