chocolatey/chocolatey — pull request #149 by mwrock (2012-09-09 14:28:34+00:00)
Title: Add function to install environment variables

This is similar to Install-ChocolateyPath but it will create persistent environment variables by any name. The logic is the same: If the EnvironmentVariableTarget is Machine, then the shell is elevated to admin. Also, $env: is set so that the variable can be used in the current shell.

This should be useful for installs like the jdk that need to set javahome and other non path environment variables.