Note: This is the migration API reference for FAKE 5. The new (modularized) API documentation can be found here. If the API is already migrated you can check here if exists in a module. More information regarding the migration can be found here

Environment

This module contains functions which allow to read and write environment variables and build parameters

Functions and values

Function or valueDescription
environVar(name)
Signature: name:string -> string

Retrieves the environment variable with the given name

environVarOrDefault name defaultValue
Signature: name:string -> defaultValue:string -> string

Retrieves the environment variable with the given name or returns the default if no value was set

environVarOrFail(name)
Signature: name:string -> string

Retrieves the environment variable with the given name or fails if not found

environVarOrNone(name)
Signature: name:string -> string option

Retrieves the environment variable or None

environVars()
Signature: unit -> (obj * obj) list

Retrieves all environment variables from the given target

fakeContextAssembly()
Signature: unit -> Assembly
fakeVersion
Signature: string

Gets the FAKE version no.

fakeVersionStr
Signature: string

Gets the FAKE Version string

fsCoreAssembly()
Signature: unit -> Assembly
getAssemblyFromType(t)
Signature: t:Type -> Assembly
getEnvironmentVarAsBool(varName)
Signature: varName:string -> bool

Retrieves the environment variable with the given name or returns the false if no value was set

getEnvironmentVarAsBoolOrDefault(...)
Signature: varName:string -> defaultValue:bool -> bool

Retrieves the environment variable with the given name or returns the default bool if no value was set

hasEnvironVar(name)
Signature: name:string -> bool

Returns if the build parameter with the given name was set

setEnvironVar name value
Signature: name:string -> value:string -> unit

Sets the environment variable with the given name