env.variable usage in skripts

Hi, i want to generate a Variable at Buildtime( for example env.filename ) that i can use in en Email Templete.
1.) i create an parameter called enf.filename with an default Value (

env.Filename with filename.exe as Value

2.) i create a powershell script, that builds a name with Date and Time.

$myfilename=get-date -format "dd_MM_yyyy_HH_mm_ss"
$myfilename="release_" + $myfilename + ".exe"
"##teamcity[setParameter name='env.filename' value='$myfilename']"

3.) i try to use this parameter as a parameter for a compress skript, but i get as env.filename only filename.exe and not the release_xx_xx....exe

Whats wrong ?

1 comment
Comment actions Permalink

hi, i simple want to Update an Env. Variable but i cant cange it in an Powershell script.
I try this one

echo 3 %env.currentBuildNumber%
"##teamcity[setParameter name='env.currentBuildNumber' value='5']"
echo 3 %env.currentBuildNumber%

so i get Still the a Message that i should register the Variable currentBuildNumber
so if i register this Parameter with an Value ( example 12 )
so the Skript above still show the Variable Value 12

So whats wrong ?

0

Please sign in to leave a comment.