Summary
Retrieves the value of the environment variable or null
if the environment variable does not exist.
Syntax
[CakeMethodAlias]
[CakeAliasCategory("Environment Variables")]
public static string EnvironmentVariable(this ICakeContext context, string variable)
Examples
Information(EnvironmentVariable("HOME") ?? "Unknown location");
Attributes
Parameters
Name |
Type |
Description |
context |
ICakeContext |
The context. |
variable |
string |
The environment variable. |
Return Value
Type |
Description |
string |
The environment variable or null if the environment variable does not exist. |