You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 6 Next »

The agent object $Agent is available for fields which are evaluated on the agent, such as Stage Actions, Workspace Rules, and Expression Variables, and also Agent Requirements.  It provides access to the properties of the current agent.

Properties

NameDescriptionTypeUsage Example
HostnameThe agents host nameString$Agent.Hostname$AGENTMACHINE
InstallPathThe installation path of the agentString$Agent.InstallPath$C:\Program Files\VSoft Technologies\ContinuaCI Agent
NowThe current date and time given as local to the agentDateTime$Agent.Now$15/10/2018 10:43:09 AM
NowUTCThe current date and time given as UTCDateTime$Agent.NowUtc$14/10/2018 11:43:09 PM
PortThe port number used for agent communicationNumber$Agent.Port$9000
n/aUnder the Agent object is a list of the current agent property collectors accessible by property namespace and nameString$Agent.NuGet.Default.Path$C:\Program Files\NuGet\NuGet.exe


Functions

NameDescriptionReturn TypeUsage Example
GetMachineEnvironmentVariable(string name)Gets the specified Windows machine environment variable (relative to the agent machine)String$Agent.GetMachineEnvironmentVariable("NUMBER_OF_PROCESSORS")$8
GetProcessEnvironmentVariable(string name)Gets the specified Windows process environment variable (relative to current process, the agent machine's service user, and the agent machine)String$Agent.GetProcessEnvironmentVariable("ContinuaCI.Build.BuildNumber")$9
GetUserEnvironmentVariable(string name)Gets the specified Windows user environment variable (relative to the agent machine's service user and the agent machine)String$Agent.GetUserEnvironmentVariable("TEMP")$C:\Users\jbloggs\AppData\Local\Temp
  • No labels