Environment aliases

Built-In

Contains functionality related to the environment.

Environment Variables

EnvironmentVariable(string) Retrieves the value of the environment variable or null if the environment variable does not exist.
EnvironmentVariable<T>(string, T) Retrieves the value of the environment variable or defaultValue if the environment variable does not exist.
EnvironmentVariables() Retrieves all environment variables.
HasEnvironmentVariable(string) Checks for the existence of a value for a given environment variable.

Platform

IsRunningOnLinux() Determines whether the build script running on a Linux based system.
IsRunningOnMacOs() Determines whether the build script running on a macOS based system.
IsRunningOnUnix() Determines whether the build script running on a Unix or Linux based system.
IsRunningOnWindows() Determines whether the build script is running on Windows.

Cake.ArgumentHelpers addin

Contains Aliases for helping work with combinations of Argument and Environment variables.

Argument

ArgumentOrEnvironmentVariable(string, bool)
Alias from Cake.ArgumentHelpers addin
Get a bool variable from various script inputs: first via Argument, then falling back on EnvironmentVariable, finally falling back on a default.
ArgumentOrEnvironmentVariable(string, string)
Alias from Cake.ArgumentHelpers addin
Get a string variable from various script inputs: first via Argument, then falling back on EnvironmentVariable, finally falling back on a default.
ArgumentOrEnvironmentVariable(string, string, bool)
Alias from Cake.ArgumentHelpers addin
Get a bool variable from various script inputs: first via Argument, then falling back on EnvironmentVariable, finally falling back on a default.
ArgumentOrEnvironmentVariable(string, string, string)
Alias from Cake.ArgumentHelpers addin
Get a string variable from various script inputs: first via Argument, then falling back on EnvironmentVariable, finally falling back on a default.