getEnvironmentVariable

Returns the value of an environment variable by name. Returns an empty string when the variable is not set. Available when the security cargo feature is enabled.

getEnvironmentVariable(name) → returns string

This function requires RustCFML.  Not supported on Lucee, Adobe ColdFusion, etc.

Argument Reference

name string
Required

The name of the environment variable.

Examples
Sample code invoking the getEnvironmentVariable function

Get the HOME environment variable.

writeDump(getEnvironmentVariable("HOME"));

Signup for cfbreak to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.

Fork me on GitHub