INFO

This API documentation is for FAKE version 5.0 or later. The old API documentation can be found here for migration or here for fake 4

This is part of the Fake.Core.Environment module.

Environment

Nested types and modules

ModuleDescription
Internal

Functions and values

Function or valueDescription
clearEnvironVar(name)
Signature: name:string -> unit

Clears the environment variable with the given name for the current process.

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

Retrieves the environment variable with the given name

environVarAsBool(varName)
Signature: varName:string -> bool

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

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

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

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 -> (string * string) list

Retrieves all environment variables from the given target

getBuildParam(name)
Signature: name:string -> string
Attributes:
[<Obsolete("Use 'environVarOrDefault name String.Empty' instead")>]
OBSOLETE

Use 'environVarOrDefault name String.Empty' instead

Returns the value of the build parameter with the given name if it was set and otherwise an empty string

getBuildParamOrDefault(...)
Signature: name:string -> defaultParam:string -> string
Attributes:
[<Obsolete("Use environVarOrDefault instead")>]
OBSOLETE

Use environVarOrDefault instead

Returns the value of the build parameter with the given name if it was set and otherwise the given default value

getDefaultEncoding()
Signature: unit -> Encoding

Contains the IO encoding which is given via build parameter "encoding" or the default encoding if no encoding was specified.

getNewestTool(possibleToolPaths)
Signature: possibleToolPaths:seq<'?8425> -> '?8425
Type parameters: '?8425

Helper function to help find framework or sdk tools from the newest toolkit available

getTargetPlatformDir(platformVersion)
Signature: platformVersion:string -> string

Gets the local directory for the given target platform

hasBuildParam(name)
Signature: name:string -> bool
Attributes:
[<Obsolete("Use hasEnvironVar instead")>]
OBSOLETE

Use hasEnvironVar instead

Returns if the build parameter with the given name was set

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

Returns if the build parameter with the given name was set

isDotnetCore
Signature: bool
Attributes:
[<Obsolete("Use isDotNetCore instead (different casing of 'N')")>]
OBSOLETE

Use isDotNetCore instead (different casing of 'N')

isDotNetCore
Signature: bool
isLinux
Signature: bool

Determines if the current system is a Linux system

isMacOS
Signature: bool

Determines if the current system is a MacOs system

isMono
Signature: bool

Determines if the current FAKE runner is being run via mono. With the FAKE 5 runner, this will always be false Todo: Detect mono on windows

isUnix
Signature: bool

Determines if the current system is an Unix system. See http://www.mono-project.com/docs/faq/technical/#how-to-detect-the-execution-platform

isWindows
Signature: bool

Determines if the current system is a Windows system

monoPath
Signature: string
monoVersion
Signature: (string * Version option) option

required sometimes to workaround mono crashes http://stackoverflow.com/a/8414517/1269722 Note: Only given when we are running on mono, represents the version of the mono runtime we are currently running on. In netcore world you can retrieve the mono version in the environment (PATH) via Fake.Core.Process.Mono.monoVersion

pathDirectories
Signature: seq<string>

Gets the list of valid directories included in the PATH environment variable.

ProgramFiles
Signature: string

The path of the "Program Files" folder - might be x64 on x64 machine

ProgramFilesX86
Signature: string

The path of Program Files (x86) It seems this covers all cases where PROCESSOR_ARCHITECTURE may misreport and the case where the other variable PROCESSOR_ARCHITEW6432 can be null

sdkBasePath
Signature: string

Base path for getting tools from windows SDKs

setBuildParam(name value)
Signature: name:string -> value:string -> unit
Attributes:
[<Obsolete("Use setEnvironVar instead")>]
OBSOLETE

Use setEnvironVar instead

Sets the build parameter with the given name for the current process.

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

Sets the environment variable with the given name

splitEnvironVar(name)
Signature: name:string -> string list

Splits the entries of an environment variable and removes the empty ones.

SystemRoot
Signature: string

The system root environment variable. Typically "C:\Windows"