Exemplo n.º 1
0
        protected override void ProcessRecordInEH()
        {
            EnvironmentVariableTarget target = EnvironmentVariableTarget.Process;

            switch (Target)
            {
            case "User":
                target = EnvironmentVariableTarget.User;
                break;

            case "Machine":
                target = EnvironmentVariableTarget.Machine;
                break;
            }

            string value = EnvironmentVariableUtils.Get(Key, target);

            WriteObject(value);
        }
Exemplo n.º 2
0
        protected override void ProcessRecordInEH()
        {
            EnvironmentVariableTarget target = EnvironmentVariableTarget.Process;

            switch (Target)
            {
            case "User":
                target = EnvironmentVariableTarget.User;
                break;

            case "Machine":
                target = EnvironmentVariableTarget.Machine;
                break;
            }

            EnvironmentVariableUtils.Set(Key, Value, target);

            if (target != EnvironmentVariableTarget.Process)
            {
                Environment.SetEnvironmentVariable(Key, Value);
            }
        }
 protected override void ProcessRecordInEH()
 {
     EnvironmentVariableUtils.Refresh(_async);
 }