PowerShell Functions aka Helpers Reference

Main Functions

These functions call other functions and many times may be the only thing you need in your chocolateyInstall.ps1 file.

Error / Success Functions

You really don't need a try catch with Chocolatey PowerShell files anymore.

More Functions

Administrative Access Functions

When creating packages that need to run one of the following commands below, one should add the tag admin to the nuspec.

Non-Administrator Safe Functions

When you have a need to run Chocolatey without Administrative access required (non-default install location), you can run the following functions without administrative access.

These are the functions from above as one list.

Complete List (alphabetical order)


There are also a number of environment variables providing access to some values from the nuspec and other information that may be useful. They are accessed via $env:variableName.

chocolateyPackageVersion may be particularly useful, since that would allow you in some cases to create packages for new releases of the updated software by only changing the <version> in the nuspec and not having to touch the chocolateyInstall.ps1 at all. An example of this:

$url = "http://www.thesoftware.com/downloads/thesoftware-$env:chocolateyPackageVersion.zip"

Install-ChocolateyZipPackage '$env:chocolateyPackageName' $url $binRoot