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

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

问题描述

我在 mac 上安装了 VSTS 构建代理来构建 xamarin iOS 项目.构建工作正常,直到我添加了 powershell 构建步骤.即使我为 mac 安装了 powershell(

使用以下 bash 脚本:

#!/bin/bashPowerShell ./SetAppVersion.ps1

另外,powershell 安装程序似乎没有将 powershell 添加到我的 PATH 中,所以我不得不添加它:

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

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.

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

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

Is it possible to run powershell build step on Mac?

解决方案

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

As a workaround I used ShellScript task:

With the following bash script:

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

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天全站免登陆