Exemplo n.º 1
0
 public object Convert(string key, ParameterDictionary d)
 {
     if(d.ContainsKey(key))
     {
         return true;
     }else{
         return false;
     }
 }
Exemplo n.º 2
0
        public void ParameterDictionary_Constructor_Success()
        {
            var dictionary = new ParameterDictionary("test", 8);

            Assert.IsNotNull(dictionary, "The dictionary should not be null");
            Assert.AreEqual(1, dictionary.Count, "There should be 1 entry in the dictionary");
            Assert.IsTrue(dictionary.ContainsKey("test"), "The key was not populated");
            Assert.AreEqual(8, dictionary["test"], "The value was not populated");
        }
Exemplo n.º 3
0
        public void LogParameters()
        {
            if (!Cmdlet.IsVerbose)
            {
                return;
            }

            var parms = new ParameterDictionary(Cmdlet);

            if (parms.ContainsKey("Password") && parms["Password"] != null)
            {
                parms["Password"] = "******";
            }

            Log($"Running cmdlet with parameter set '{parms.Get<string>("ParameterSetName")}' and the following arguments:");

            Log(JObject.FromObject(parms)
                .ToString(Formatting.None)
                .Replace("\":", "\" = ")
                .Replace(",\"", "; \"")
                .Trim('{', '}')
                );
        }