Agent Object

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

Name Description Type Usage Example
Hostname The agent's host name String $Agent.Hostname$ "AGENTMACHINE"
InstallPath The installation path of the agent String $Agent.InstallPath$ "C:\Program Files\VSoft Technologies\ContinuaCI Agent"
Now The current date and time given as local to the agent DateTime $Agent.Now$ "15/10/2018 10:43:09 AM"
NowUTC The current date and time given as UTC DateTime $Agent.NowUtc$ "14/10/2018 11:43:09 PM"
Port The port number used for agent communication Number $Agent.Port$ 9000
n/a Under the Agent object is a list of the current agent property collectors accessible by property namespace and name String $Agent.NuGet.Default.Path$ "C:\Program Files\NuGet\NuGet.exe"

Functions

Name Description Return Type Usage 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"