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

Environment

Nested types and modules

TypeDescription
EnvironTarget

Type alias for System.EnvironmentVariableTarget

ModuleDescription
Internal

Functions and values

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

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

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

Retrieves the environment variable with the given name

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

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

Environment.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

Environment.environVarOrDefault(...)
Signature: name:string -> defaultValue:string -> string

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

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

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

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

Retrieves the environment variable or None

Environment.environVars()
Signature: unit -> (string * string) list

Retrieves all environment variables from the given target

Environment.environVarsWithMode(mode)
Signature: mode:EnvironmentVariableTarget -> (obj * obj) list
Attributes:
[<Obsolete("Will be removed in dotnetcore. Use environVars instead.")>]
OBSOLETE

Will be removed in dotnetcore. Use environVars instead.

Environment.getBuildParam(name)
Signature: name:string -> string
Modifiers: inline
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

Environment.getBuildParamOrDefault(...)
Signature: name:string -> defaultParam:string -> string
Modifiers: inline
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

Environment.getDefaultEncoding()
Signature: unit -> Encoding

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

Environment.getNewestTool(...)
Signature: possibleToolPaths:seq<'?8134> -> '?8134
Type parameters: '?8134

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

Environment.getNuGetPackagesCacheFolder(...)
Signature: unit -> string

Returns the path to the user-specific nuget packages folder

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

Gets the local directory for the given target platform

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

Use hasEnvironVar instead

Returns if the build parameter with the given name was set

Environment.hasEnvironVar(name)
Signature: name:string -> bool
Modifiers: inline

Returns if the build parameter with the given name was set

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

Use isDotNetCore instead (different casing of 'N')

Environment.isDotNetCore
Signature: bool
Environment.isLinux
Signature: bool

Determines if the current system is a Linux system

Environment.isMacOS
Signature: bool

Determines if the current system is a MacOs system

Environment.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

Environment.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

Environment.isWindows
Signature: bool

Determines if the current system is a Windows system

Environment.monoPath
Signature: string
Environment.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

Environment.pathDirectories
Signature: seq<string>

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

Environment.ProgramFiles
Signature: string

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

Environment.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

Environment.sdkBasePath
Signature: string

Base path for getting tools from windows SDKs

Environment.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.

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

Sets the environment variable with the given name

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

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

Environment.SystemRoot
Signature: string

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