开发者

How to get the currently logged in windows user with NAnt

I have a NAnt script that does a build and deployment of an ASP.Net application.

This lives on a remote machine that many people log into to perform builds.

(this is not automated for various reasons that are irrelevant)

Upon s开发者_运维问答uccess or failure of the Nant script, I have an email being sent out to a team distribution list, stating that the build was successful or failed. I would like to be able to list the name of the user who logged into the remote machine to run the build script in the text of the email.

Is this possible in NAnt? I am using the standard NAnt <mail> task to do the email.


Check environment::get-user-name() function. It gets the user name of the person who started the current thread (nant process).

<mail 
  ...
  subject="Build run by ${environment::get-user-name()}" 
  ...
</mail>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜