static void ConfigAdd(string[] args) { var squirrel = new SquirrelClient(new Uri("http://localhost:49622/squirrel"), "crm"); var nut = new Nut { Table="ConnectionStrings", Key = "test", Value = "<endpoint xmlns='testing'><b>testing</b></endpoint>" }; squirrel.Add(nut); }
static void Main(string[] args) { var squirrel = new SquirrelClient(new Uri("http://localhost/squirrel"), "crm"); Nut nut = new Nut() { Table="ConnectionStrings", Key = "intranetdb", Value = "this is my development intranet db connectionstring", Properties = new Dictionary<string,string>() }; nut.Properties.Add("environment", "Development"); squirrel.Add(nut); var cs = squirrel.Get("ConnectionStrings", "aem"); Console.WriteLine(cs.Value); }
protected override void ProcessRecord() { try { var uri = Uri; var tokens = uri.Split('/'); var account = tokens[1]; var table = tokens[0]; var name = tokens[2]; var squirrel = new SquirrelClient(new Uri("http://localhost/squirrel"), account); var nut = new Nut() { Key = name, Table = table, Value = Value }; squirrel.Add(nut); WriteObject("Nut added"); } catch (Exception eax) { WriteError(new ErrorRecord(eax, "", ErrorCategory.InvalidOperation, this)); } }