Error starting powershell task in TFS Build vnext

I have a very simple script that spits out environment variables like this:

Write-Host "SYSTEM_TEAMPROJECT: $ENV:SYSTEM_TEAMPROJECT"

My build has one step - the PowerShell task. The script filename task is set to the script path in TFSVC, for example. $ / Home / BuildProcessTemplates / AllProps.ps1.

When I queue a new assembly, it does not report the following error: The term "C: \ Builds \ agent_work \ cb535ea3 \ Main" is not recognized as the name of the cmdlet, function, script file or healthy Check the spelling of the name or specify the path, make sure that the path is correct and try again. "

Did I configure the task incorrectly?

- UPDATE: here is a copy of powershell task View a PowerShell Task

+4
source share
1 answer

On the repository tab, you need to enable the script as shown below. If you have a script directory, you can select a folder instead.

enter image description here

+5
source

Source: https://habr.com/ru/post/1606290/


All Articles