简体   繁体   中英

How to run PowerShell task on TFS Linux agent?

I have a release pipeline in TFS 2017, which runs on Linux agent and has Docker and PowerShell tasks. However Docker tasks are working fine but PowerShell tasks are failing because there is no.Net Framework installed.

What is the way to run PowerShell task on Linux agent or how to install.Net Framework on Linux agent?

TFS 2017 predates support for PowerShell Core, which is cross-platform and runs on Linux. So the built-in PowerShell task is going to be useless for this scenario.

However, you can still run a PowerShell script on your Linux agent, you'll just have to use a Command Line task to call pwsh . Naturally, you'll have to ensure that PowerShell Core is installed on your Linux agent.

Upgrading to a more recent version of TFS will also include an updated PowerShell task that includes a checkbox for "Use PowerShell Core", which will also solve the problem.

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