Exemple #1
0
        public string Run()
        {
            if (string.IsNullOrEmpty(Configuration.Name) ||
                string.IsNullOrEmpty(Configuration.CMSUrl) ||
                string.IsNullOrEmpty(Configuration.Username) ||
                string.IsNullOrEmpty(Configuration.Password))
            {
                return
                    ("Failed - you need to supply a name, url, username and password. Type dyndle help environment for help.");
            }

            try
            {
                EnvironmentManager.Add(Configuration.Name, Configuration.CMSUrl, Configuration.Username,
                                       Configuration.UserDomain, Configuration.Password, Configuration.MakeDefault);
            }
            catch (Exception e)
            {
                return("Failed - " + e.Message);
            }
            return("Successfully added environment");
        }