SetEnv Task

 

For the latest documentation on Visual Studio 2017, see Visual Studio 2017 Documentation.

For the latest documentation on Visual Studio 2017, see SetEnv Task on docs.microsoft.com. Sets or deletes the value of a specified environment variable.

The following table describes the parameters of the SetEnv task.

ParameterDescription
NameRequired String parameter.

The name of an environment variable.
OutputEnvironmentVariableOptional String output parameter.

Contains the value that is assigned to the environment variable that is specified by the Name parameter.
PrefixMandatory Boolean parameter.

If true, concatenates the value of the Value parameter before the value of the environment variable that is specified by the Name parameter, and then assigns the result to the environment variable. If false, assigns only the value of the Value parameter to the environment variable.
TargetOptional String parameter.

Specifies the location where an environment variable is stored. Specify "User" or "Machine".

For more information, see "EnvironmentVariableTarget Enumeration" on the MSDN Web site.
ValueOptional String parameter.

The value assigned to the environment variable that is specified by the Name parameter. If Value is empty and the variable exists, the variable is deleted. If the variable does not exist, no error occurs even though the operation cannot be performed.

For more information, see "Environment::SetEnvironmentVariable Method" on the MSDN Web site.

Task Reference

Show: