Summary
Retrieves all environment variables.
Syntax
[CakeMethodAlias]
[CakeAliasCategory("Environment Variables")]
public static IDictionary<string, string> EnvironmentVariables(this ICakeContext context)
Examples
var envVars = EnvironmentVariables();
string path;
if (envVars.TryGetValue("PATH", out path))
{
Information("Path: {0}", path);
}
foreach(var envVar in envVars)
{
Information(
"Key: {0}\tValue: \"{1}\"",
envVar.Key,
envVar.Value
);
}
Attributes
Parameters
Return Value
Type |
Description |
IDictionary<string, string> |
The environment variables. |