简体   繁体   中英

TFS Build: Run a Powershell script as administrator

I created a build definition for our nightly build server. After building the project (a windows service), I need to execute a Powershell script to install and start the service. So I added a build step to run the specific Powershell script. Then I installed a TFS Build Agent & Visual Studio at the (soon to be) nightly build server. After running the build script I got an 'exit code 5' which seems to be related to missing administratior permissions. If I start the script as admin on the server manually, it works fine. The user, which is used by the agent, already got admin permissions.

Is there a way to execute the powershell script on the build server with a build agent / build definition with admin permissions?

您只需确保您的构建服务帐户(可以是本地帐户,域帐户或工作组中的本地服务)也获得管理员权限。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM