using System; using System.Collections.Generic; using System.Text; using Microsoft.Build.Utilities; using Microsoft.Build.Framework; namespace DotNetOpenAuth.BuildTasks { public class SetEnvironmentVariable : Task { public SetEnvironmentVariable() { Scope = EnvironmentVariableTarget.Process; } /// /// The name of the environment variable to set or clear. /// [Required] public string Name { get; set; } /// /// The value of the environment variable, or the empty string to clear it. /// [Required] public string Value { get; set; } /// /// The target environment for the variable. Machine, User, or Process. /// public EnvironmentVariableTarget Scope { get; set; } public override bool Execute() { Environment.SetEnvironmentVariable(Name, Value, Scope); return true; } } }