private static void Main(string[] args) { Wsl.InitializeSecurityModel(); var hasPretty = string.Equals("--pretty", args?.FirstOrDefault(), StringComparison.OrdinalIgnoreCase); var queryResult = Wsl.GetDistroQueryResult(); Console.Out.WriteLine(JsonConvert.SerializeObject(queryResult, new JsonSerializerSettings() { ContractResolver = new CamelCasePropertyNamesContractResolver(), Formatting = hasPretty ? Formatting.Indented : Formatting.None, })); }
private static void Main() { Wsl.InitializeSecurityModel(); var methods = typeof(WslTest) .GetMethods(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static) .Where(x => x.Name.StartsWith("Test_", StringComparison.Ordinal)) .OrderBy(x => Guid.NewGuid()) .ToArray(); var targets = new Targets(); var methodNames = new List <string>(methods.Length); foreach (var eachMethod in methods) { methodNames.Add(eachMethod.Name); targets.Add(eachMethod.Name, () => eachMethod.Invoke(null, null)); } targets.RunAndExit(methodNames); }