Passing parameters to file ?

Completed

Hello,

how can i pass parameters to file in TeamCity. I can get it to work if i just type in my "code" under Source but i would really like to have the "file" option working to have as i can store it in my version control

Small example:

In teamCity I define a "Environment Variables" and give the properties "hidden" and "password" and of course a "Value" = XYZ

the file "GitFile.ps1" :

$Variable = %env.NAME.SOME%
write-host $Variable

Expected outcome: 

Value of Teamcity Environment parameter XYZ

As i said it works fine in source, but not in "file".

Thanks

 

 

1 comment
Comment actions Permalink

Solved:

followed this guide:
https://teamcity-support.jetbrains.com/hc/en-us/community/posts/360008219219-Passing-parameters-to-pwoershell-script

and Changed the parameter syntax from  %env:NAME.SOME% to $env:NAME_SOME (dot,":" and $)

this worked:

$Variable = $env:NAME_SOME
write-host $Variable

0

Please sign in to leave a comment.