PowerShell Step in deploy script instead of NAnt

Hi community.
I use TeamCity v8.1 and have deploy script wrote by NAnt.
I 'm going to rewrite build step by PowerShell and have a question:
in NAnt I can declare varriable of target as:

<property name="machine" value="${QaVmName}" />

and use ${machine} in my deploy script as common machine name personally and depends which tagret name will apply this script.

How I can declare varriable in PowerShell's deploy script similar NAnt?
For example in NAnt :

<property name="machine" value="${QaVmName}" />
<property name="ServerUser" value="Admin"/>
<property name="ServerPassword" value="password"/>

<exec program="net" commandline="use \\${machine} /user:${ServerUser} ${ServerPassword}" failonerror="false" verbose="true" />

And I would like to:
$machine = <????> ; - I don't know
$admin = "Admin"
$pass = "password"
$command = "@
net use \\$mashine  /user:$admin $pass
Invoke-Expression -Command $command

1 comment
Comment actions Permalink

oh, I already have desided this step.


Please sign in to leave a comment.