FAKE - F# Make - A DSL for build tasks and more FAKE
6.1.3

Lookig for older versions of the documentation, pre FAKE v6? See 

v5.fake.build

Choco Module

Contains tasks which allow to call Chocolatey

Types

Type Description

ChocoInstallParams

The choco install parameter type.

ChocoPackParams

The choco pack parameter type.

ChocoPushParams

The choco push parameter type.

ChocolateyChecksumType

The choco checksum type

ChocolateyInstallerType

The choco installer type

Functions and values

Function or value Description

Choco.ChocoInstallDefaults

Full Usage: Choco.ChocoInstallDefaults

Returns: ChocoInstallParams

The default option set given to choco install.

Returns: ChocoInstallParams

Choco.ChocoPackDefaults

Full Usage: Choco.ChocoPackDefaults

Returns: ChocoPackParams

The default option set given to choco pack.

Returns: ChocoPackParams

Choco.ChocoPushDefaults

Full Usage: Choco.ChocoPushDefaults

Returns: ChocoPushParams

The default option set given to choco push.

Returns: ChocoPushParams

Choco.IsAvailable

Full Usage: Choco.IsAvailable

Returns: bool

True if choco is available (only on windows)

Returns: bool
Example


 "Build" =?> ("ChocoInstall", Choco.IsAvailable)

Choco.exec args timeout

Full Usage: Choco.exec args timeout

Parameters:
    args : string - string that will be appended to choco.exe call
    timeout : TimeSpan - parent process maximum completion time

Call custom choco command

args : string

string that will be appended to choco.exe call

timeout : TimeSpan

parent process maximum completion time

Example


 Target "ChocoPush" (fun _ ->

          let newSpecFile = ...
          let args =
                 new StringBuilder()
                 |> append "pack"
                 |> append newSpecFile
                 |> append "-y"
                 |> toText

         args |> Choco.CallChoco TimeSpan.FromMinutes 1.
     )

Choco.findExe

Full Usage: Choco.findExe

Returns: string option

Tries to find the specified choco executable: 1. In the <ProgramData>\chocolatey\bin directory 2. In the PATH environment variable.

Returns: string option

Choco.install setParams packages

Full Usage: Choco.install setParams packages

Parameters:
    setParams : ChocoInstallParams -> ChocoInstallParams - Function used to manipulate the default choco parameters. See ChocoInstallParams
    packages : string - Names of packages, path to packages.config, .nuspec or .nupkg to install

Call choco to install a package

setParams : ChocoInstallParams -> ChocoInstallParams

Function used to manipulate the default choco parameters. See ChocoInstallParams

packages : string

Names of packages, path to packages.config, .nuspec or .nupkg to install

Example


 Target "ChocoInstall" (fun _ ->
         "pretzel" |> Choco.Install (fun p -> { p with Version = "0.4.0" })
     )

Choco.pack setParams

Full Usage: Choco.pack setParams

Parameters:

Call choco to pack a package and create .nuspec, chocolateyInstall.ps1 and chocolateyUninstall.ps1 if information are specified

setParams : ChocoPackParams -> ChocoPackParams

Function used to manipulate the default choco parameters. See ChocoPackParams

Example


 Target "ChocoPack" (fun _ ->
         Choco.Pack (fun p -> { p with Version = "0.5.0"; ... })
     )

Choco.packFromTemplate setParams nuspecPath

Full Usage: Choco.packFromTemplate setParams nuspecPath

Parameters:
    setParams : ChocoPackParams -> ChocoPackParams - Function used to manipulate the default choco parameters. See ChocoPackParams
    nuspecPath : string - path to the .nuspec to pack

Call choco to pack a package

setParams : ChocoPackParams -> ChocoPackParams

Function used to manipulate the default choco parameters. See ChocoPackParams

nuspecPath : string

path to the .nuspec to pack

Example


 Target "ChocoPack" (fun _ ->
         "pretzel.nuspec" |> Choco.Pack (fun p -> { p with Version = "0.5.0" })
     )

Choco.push setParams nupkgPath

Full Usage: Choco.push setParams nupkgPath

Parameters:
    setParams : ChocoPushParams -> ChocoPushParams - Function used to manipulate the default choco parameters. See ChocoPushParams
    nupkgPath : string - path to the .nupkg to push

Call choco to push a package

setParams : ChocoPushParams -> ChocoPushParams

Function used to manipulate the default choco parameters. See ChocoPushParams

nupkgPath : string

path to the .nupkg to push

Example


 Target "ChocoPush" (fun _ ->
         "pretzel.0.5.0.nupkg" |> Choco.Push (fun p -> { p with ApiKey = "123-123123-123" })
     )