使用 PowerShell x86 运行 TFS Build [英] TFS Build using PowerShell x86 to run

查看:21
本文介绍了使用 PowerShell x86 运行 TFS Build的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前有一个构建定义设置,我在其中调用 PowerShell 脚本来执行一些额外操作",例如使用自定义版本号和 DLL 签名.我遇到的一个问题是,在我的 PowerShell 脚本中,我试图加载一个程序集,以便我可以创建特定类型的对象,但在我尝试加载程序集时出现错误.我发现我需要加载的程序集需要脚本作为 x86 进程运行.

I currently have a build definition setup where I call a PowerShell script to do some "extra stuff" such as using a custom version number and DLL signing. A problem I'm having is that in my PowerShell script, I am trying to load an assembly so that I can create an object of a certain type and that I get an error when I try loading the assembly. I found out that the assembly that I need to load requires the script to run as a x86 process.

当我将 PowerShell 脚本作为 Windows Powershell x86 而不是常规的 Windows PowerShell 进程运行时,我发现了这一点.在我的构建定义中有没有一种方法可以说明我可以作为哪个进程运行?比如构建过程模板甚至脚本本身?

I found this out when I ran my PowerShell script as a Windows Powershell x86 instead of the regular Windows PowerShell process. Is there a way in my build definition where I can state which process I can run as? Such as the build process template or even in the script itself?

推荐答案

为什么不从 MSBuild 启动 x86 版本的 PowerShell?

Why don't you launch the x86 version of PowerShell from MSBuild?

<Exec Command="$(WinDir)\SysWOW64\WindowsPowerShell\v1.0\powershell.exe myscript.ps1"/>

如果您使用的是 TeamBuild 的工作流变体,只需从 SysWOW64 路径启动 PowerShell.exe.

If you're using the workflow variant of TeamBuild, just fire off PowerShell.exe from the SysWOW64 path.

这篇关于使用 PowerShell x86 运行 TFS Build的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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