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

OBSOLETE

Use Fake.Core.Environment instead (FAKE0001 - package: Fake.Core.Environment)

EnvironmentHelper

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

Nested types and modules

TypeDescription
EnvironTarget
OBSOLETE

Use Fake.Core.Environment instead (FAKE0001 - package: Fake.Core.Environment)

Type alias for System.EnvironmentVariableTarget

MachineDetails
OBSOLETE

Use Fake.Core.Environment instead (FAKE0001 - package: Fake.Core.Environment)

A record which allows to display lots of machine specific information like machine name, processor count etc.

Functions and values

Function or valueDescription
( @@ ) path1 path2
Signature: path1:string -> path2:string -> string
Attributes:
[<Obsolete("Use Fake.IO.FileSystemOperators instead (FAKE0001 - package: Fake.IO.FileSystem)")>]
OBSOLETE

Use Fake.IO.FileSystemOperators instead (FAKE0001 - package: Fake.IO.FileSystem)

Combines two path strings using Path.Combine after removing leading slashes from the second path

( </> ) path1 path2
Signature: path1:string -> path2:string -> string
Attributes:
[<Obsolete("Use Fake.IO.FileSystemOperators instead (FAKE0001 - package: Fake.IO.FileSystem)")>]
OBSOLETE

Use Fake.IO.FileSystemOperators instead (FAKE0001 - package: Fake.IO.FileSystem)

Combines two path strings using Path.Combine

appSetting(name)
Signature: name:string -> string
Attributes:
[<Obsolete("Use Fake.Core.Environment instead (FAKE0001 - package: Fake.Core.Environment)")>]
OBSOLETE

Use Fake.Core.Environment instead (FAKE0001 - package: Fake.Core.Environment)

Retrieves the application settings variable with the given name

clearProcessEnvironVar(name)
Signature: name:string -> unit
Attributes:
[<Obsolete("Use Fake.Core.Environment instead (FAKE0001 - package: Fake.Core.Environment)")>]
OBSOLETE

Use Fake.Core.Environment instead (FAKE0001 - package: Fake.Core.Environment)

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

combinePaths path1 path2
Signature: path1:string -> path2:string -> string
Attributes:
[<Obsolete("Use Fake.IO instead (FAKE0001 - package: Fake.IO.FileSystem)")>]
OBSOLETE

Use Fake.IO instead (FAKE0001 - package: Fake.IO.FileSystem)

Combines two path strings using Path.Combine after removing leading slashes from the second path

combinePathsNoTrim path1 path2
Signature: path1:string -> path2:string -> string
Attributes:
[<Obsolete("Use Fake.IO instead (FAKE0001 - package: Fake.IO.FileSystem)")>]
OBSOLETE

Use Fake.IO instead (FAKE0001 - package: Fake.IO.FileSystem)

Combines two path strings using Path.Combine

convertWindowsToCurrentPath(windowsPath)
Signature: windowsPath:string -> string
Attributes:
[<Obsolete("Use Fake.Core.Environment instead (FAKE0001 - package: Fake.Core.Environment)")>]
OBSOLETE

Use Fake.Core.Environment instead (FAKE0001 - package: Fake.Core.Environment)

Convert the given windows path to a path in the current system

directorySeparator
Signature: string
Attributes:
[<Obsolete("Use Fake.Core.Environment instead (FAKE0001 - package: Fake.Core.Environment)")>]
OBSOLETE

Use Fake.Core.Environment instead (FAKE0001 - package: Fake.Core.Environment)

The directory separator string. On most systems / or \

documentsFolder
Signature: string
Attributes:
[<Obsolete("Use Fake.Core.Environment instead (FAKE0001 - package: Fake.Core.Environment)")>]
OBSOLETE

Use Fake.Core.Environment instead (FAKE0001 - package: Fake.Core.Environment)

The path to the personal documents

encoding
Signature: Encoding
Attributes:
[<Obsolete("Use Fake.Core.Environment instead (FAKE0001 - package: Fake.Core.Environment)")>]
OBSOLETE

Use Fake.Core.Environment instead (FAKE0001 - package: Fake.Core.Environment)

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

environVar(name)
Signature: name:string -> string
Attributes:
[<Obsolete("Use Fake.Core.Environment instead (FAKE0001 - package: Fake.Core.Environment)")>]
OBSOLETE

Use Fake.Core.Environment instead (FAKE0001 - package: Fake.Core.Environment)

Retrieves the environment variable with the given name

environVarOrDefault name defaultValue
Signature: name:string -> defaultValue:string -> string
Attributes:
[<Obsolete("Use Fake.Core.Environment instead (FAKE0001 - package: Fake.Core.Environment)")>]
OBSOLETE

Use Fake.Core.Environment instead (FAKE0001 - package: Fake.Core.Environment)

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

environVarOrFail(name)
Signature: name:string -> string
Attributes:
[<Obsolete("Use Fake.Core.Environment instead (FAKE0001 - package: Fake.Core.Environment)")>]
OBSOLETE

Use Fake.Core.Environment instead (FAKE0001 - package: Fake.Core.Environment)

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

environVarOrNone(name)
Signature: name:string -> string option
Attributes:
[<Obsolete("Use Fake.Core.Environment instead (FAKE0001 - package: Fake.Core.Environment)")>]
OBSOLETE

Use Fake.Core.Environment instead (FAKE0001 - package: Fake.Core.Environment)

Retrieves the environment variable or None if no value was set

environVars(target)
Signature: target:EnvironmentVariableTarget -> (obj * obj) list
Attributes:
[<Obsolete("Use Fake.Core.Environment instead (FAKE0001 - package: Fake.Core.Environment)")>]
OBSOLETE

Use Fake.Core.Environment instead (FAKE0001 - package: Fake.Core.Environment)

Retrieves all environment variables from the given target

getBuildParam(name)
Signature: name:string -> string
Attributes:
[<Obsolete("Use Fake.Core.Environment instead (FAKE0001 - package: Fake.Core.Environment)")>]
OBSOLETE

Use Fake.Core.Environment instead (FAKE0001 - package: Fake.Core.Environment)

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

getBuildParamOrDefault name defaultParam
Signature: name:string -> defaultParam:string -> string
Attributes:
[<Obsolete("Use Fake.Core.Environment instead (FAKE0001 - package: Fake.Core.Environment)")>]
OBSOLETE

Use Fake.Core.Environment instead (FAKE0001 - package: Fake.Core.Environment)

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

getDrivesInfo()
Signature: unit -> seq<string>
Attributes:
[<Obsolete("Use Fake.Core.Environment instead (FAKE0001 - package: Fake.Core.Environment)")>]
OBSOLETE

Use Fake.Core.Environment instead (FAKE0001 - package: Fake.Core.Environment)

Retrieves information about the hard drives

getEnvironmentVarAsBool(varName)
Signature: varName:string -> bool
Attributes:
[<Obsolete("Use Fake.Core.Environment instead (FAKE0001 - package: Fake.Core.Environment)")>]
OBSOLETE

Use Fake.Core.Environment instead (FAKE0001 - package: Fake.Core.Environment)

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

getEnvironmentVarAsBoolOrDefault(...)
Signature: varName:string -> defaultValue:bool -> bool
Attributes:
[<Obsolete("Use Fake.Core.Environment instead (FAKE0001 - package: Fake.Core.Environment)")>]
OBSOLETE

Use Fake.Core.Environment instead (FAKE0001 - package: Fake.Core.Environment)

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

getInstalledDotNetFrameworks()
Signature: unit -> seq<string>
Attributes:
[<Obsolete("Use Fake.Core.Environment instead (FAKE0001 - package: Fake.Core.Environment)")>]
OBSOLETE

Use Fake.Core.Environment instead (FAKE0001 - package: Fake.Core.Environment)

Returns a sequence with all installed .NET framework versions

getMachineEnvironment()
Signature: unit -> MachineDetails
Attributes:
[<Obsolete("Use Fake.Core.Environment instead (FAKE0001 - package: Fake.Core.Environment)")>]
OBSOLETE

Use Fake.Core.Environment instead (FAKE0001 - package: Fake.Core.Environment)

Retrieves lots of machine specific information like machine name, processor count etc.

getNewestTool(possibleToolPaths)
Signature: possibleToolPaths:seq<'a> -> 'a
Type parameters: 'a Attributes:
[<Obsolete("Use Fake.Core.Environment instead (FAKE0001 - package: Fake.Core.Environment)")>]
OBSOLETE

Use Fake.Core.Environment instead (FAKE0001 - package: Fake.Core.Environment)

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

getTargetPlatformDir(platformVersion)
Signature: platformVersion:string -> string
Attributes:
[<Obsolete("Use Fake.Core.Environment instead (FAKE0001 - package: Fake.Core.Environment)")>]
OBSOLETE

Use Fake.Core.Environment instead (FAKE0001 - package: Fake.Core.Environment)

Gets the local directory for the given target platform

hasBuildParam(name)
Signature: name:string -> bool
Attributes:
[<Obsolete("Use Fake.Core.Environment instead (FAKE0001 - package: Fake.Core.Environment)")>]
OBSOLETE

Use Fake.Core.Environment instead (FAKE0001 - package: Fake.Core.Environment)

Returns if the build parameter with the given name was set

isLinux
Signature: bool
Attributes:
[<Obsolete("Use Fake.Core.Environment instead (FAKE0001 - package: Fake.Core.Environment)")>]
OBSOLETE

Use Fake.Core.Environment instead (FAKE0001 - package: Fake.Core.Environment)

Determines if the current system is a Linux system

isMacOS
Signature: bool
Attributes:
[<Obsolete("Use Fake.Core.Environment instead (FAKE0001 - package: Fake.Core.Environment)")>]
OBSOLETE

Use Fake.Core.Environment instead (FAKE0001 - package: Fake.Core.Environment)

Determines if the current system is a MacOs system

isMono
Signature: bool
Attributes:
[<Obsolete("Use Fake.Core.Environment instead (FAKE0001 - package: Fake.Core.Environment)")>]
OBSOLETE

Use Fake.Core.Environment instead (FAKE0001 - package: Fake.Core.Environment)

Determines if the current system is a mono system Todo: Detect mono on windows

isUnix
Signature: bool
Attributes:
[<Obsolete("Use Fake.Core.Environment instead (FAKE0001 - package: Fake.Core.Environment)")>]
OBSOLETE

Use Fake.Core.Environment instead (FAKE0001 - package: Fake.Core.Environment)

Determines if the current system is an Unix system

isWindows
Signature: bool
Attributes:
[<Obsolete("Use Fake.Core.Environment instead (FAKE0001 - package: Fake.Core.Environment)")>]
OBSOLETE

Use Fake.Core.Environment instead (FAKE0001 - package: Fake.Core.Environment)

Determines if the current system is a Windows system

monoArguments
Signature: string
Attributes:
[<Obsolete("Use Fake.Core.Process instead (FAKE0001 - package: Fake.Core.Process)")>]
OBSOLETE

Use Fake.Core.Process instead (FAKE0001 - package: Fake.Core.Process)

Arguments on the Mono executable

monoPath
Signature: string
Attributes:
[<Obsolete("Use Fake.Core.Environment instead (FAKE0001 - package: Fake.Core.Environment)")>]
OBSOLETE

Use Fake.Core.Environment instead (FAKE0001 - package: Fake.Core.Environment)

monoVersion
Signature: (string * Version option) option
Attributes:
[<Obsolete("Use Fake.Core.Environment instead (FAKE0001 - package: Fake.Core.Environment)")>]
OBSOLETE

Use Fake.Core.Environment instead (FAKE0001 - package: Fake.Core.Environment)

required sometimes to workaround mono crashes http://stackoverflow.com/a/8414517/1269722

msSdkBasePath
Signature: string
Attributes:
[<Obsolete("Use Fake.Core.Environment instead (FAKE0001 - package: Fake.Core.Environment)")>]
OBSOLETE

Use Fake.Core.Environment instead (FAKE0001 - package: Fake.Core.Environment)

Base path for getting tools from Microsoft SDKs

normalizePath(path)
Signature: path:string -> string
Attributes:
[<Obsolete("Use Fake.IO instead (FAKE0001 - package: Fake.IO.FileSystem)")>]
OBSOLETE

Use Fake.IO instead (FAKE0001 - package: Fake.IO.FileSystem)

platformInfoAction(psi)
Signature: psi:ProcessStartInfo -> unit
Attributes:
[<Obsolete("Use Fake.Core.Process instead (FAKE0001 - package: Fake.Core.Process)")>]
OBSOLETE

Use Fake.Core.Process instead (FAKE0001 - package: Fake.Core.Process)

Modifies the ProcessStartInfo according to the platform semantics

ProgramFiles
Signature: string
Attributes:
[<Obsolete("Use Fake.Core.Environment instead (FAKE0001 - package: Fake.Core.Environment)")>]
OBSOLETE

Use Fake.Core.Environment instead (FAKE0001 - package: Fake.Core.Environment)

The path of the "Program Files" folder - might be x64 on x64 machine It seems this covers all cases where PROCESSOR_ARCHITECTURE may misreport and the case where the other variable PROCESSOR_ARCHITEW6432 can be null

ProgramFilesX86
Signature: string
Attributes:
[<Obsolete("Use Fake.Core.Environment instead (FAKE0001 - package: Fake.Core.Environment)")>]
OBSOLETE

Use Fake.Core.Environment instead (FAKE0001 - package: Fake.Core.Environment)

The path of Program Files (x86)

sdkBasePath
Signature: string
Attributes:
[<Obsolete("Use Fake.Core.Environment instead (FAKE0001 - package: Fake.Core.Environment)")>]
OBSOLETE

Use Fake.Core.Environment instead (FAKE0001 - package: Fake.Core.Environment)

Base path for getting tools from Windows SDKs

setBuildParam name value
Signature: name:string -> value:string -> unit
Attributes:
[<Obsolete("Use Fake.Core.Environment instead (FAKE0001 - package: Fake.Core.Environment)")>]
OBSOLETE

Use Fake.Core.Environment instead (FAKE0001 - package: Fake.Core.Environment)

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

setEnvironVar name value
Signature: name:string -> value:string -> unit
Attributes:
[<Obsolete("Use Fake.Core.Environment instead (FAKE0001 - package: Fake.Core.Environment)")>]
OBSOLETE

Use Fake.Core.Environment instead (FAKE0001 - package: Fake.Core.Environment)

Sets the environment variable with the given name

setMachineEnvironVar name value
Signature: name:string -> value:string -> unit
Attributes:
[<Obsolete("Use Fake.Core.Environment instead (FAKE0001 - package: Fake.Core.Environment)")>]
OBSOLETE

Use Fake.Core.Environment instead (FAKE0001 - package: Fake.Core.Environment)

Sets the environment variable with the given name for the current machine.

setProcessEnvironVar name value
Signature: name:string -> value:string -> unit
Attributes:
[<Obsolete("Use Fake.Core.Environment instead (FAKE0001 - package: Fake.Core.Environment)")>]
OBSOLETE

Use Fake.Core.Environment instead (FAKE0001 - package: Fake.Core.Environment)

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

setUserEnvironVar name value
Signature: name:string -> value:string -> unit
Attributes:
[<Obsolete("Use Fake.Core.Environment instead (FAKE0001 - package: Fake.Core.Environment)")>]
OBSOLETE

Use Fake.Core.Environment instead (FAKE0001 - package: Fake.Core.Environment)

Sets the environment variable with the given name for the current user.

splitEnvironVar(name)
Signature: name:string -> string list
Attributes:
[<Obsolete("Use Fake.Core.Environment instead (FAKE0001 - package: Fake.Core.Environment)")>]
OBSOLETE

Use Fake.Core.Environment instead (FAKE0001 - package: Fake.Core.Environment)

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

SystemRoot
Signature: string
Attributes:
[<Obsolete("Use Fake.Core.Environment instead (FAKE0001 - package: Fake.Core.Environment)")>]
OBSOLETE

Use Fake.Core.Environment instead (FAKE0001 - package: Fake.Core.Environment)

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

TargetPlatformPrefix
Signature: string
Attributes:
[<Obsolete("Use Fake.Core.Environment instead (FAKE0001 - package: Fake.Core.Environment)")>]
OBSOLETE

Use Fake.Core.Environment instead (FAKE0001 - package: Fake.Core.Environment)

The path of the current target platform