Tuesday, November 10, 2015

Passing parameters to a PowerShell build step in Jetbrains TeamCity

If you are using PowerShell scripts as part of your build steps in Jetbrains TeamCity, you may come across this article which describes how to pass parameters to your PowerShell scripts:  https://thebutlershome.wordpress.com/2013/04/28/team-city-powershell-and-parameters/

However, the example is a bit outdated for the latest version of TeamCity (v. 9.1.3 as of this writing).

Instead, you will need to pass parameters as Script arguments in this format instead:

-arg1 "test1" -arg2 "test2"

Using the "=" sign while passing parameter arguments will lead to unexpected behavior in TeamCity.

In addition, the option for "Execute .ps1 script with -File argument" no longer exists.  Instead, it has been replaced with "Execute .ps1 from external file"

1 comment: