private void UpdateCmdlets() { IEnumerable <Assembly> source = from assemb in AppDomain.CurrentDomain.GetAssemblies() where CmdletAssemblyHelper.IsCmdletAssembly(assemb.GetName().Name) select assemb; if (source.Count <Assembly>() == 0) { throw new ArgumentException("Microsoft.Exchange.Management dll is not loaded"); } DDIValidCommandTextAttribute.cmdlets.Add("New-EdgeSubscription".ToUpper()); IEnumerable <object> enumerable = from type in DDIValidationHelper.GetAssemblyTypes(source.First <Assembly>()) where !type.IsAbstract && type.GetCustomAttributes(typeof(CmdletAttribute), false).Count <object>() == 1 select type.GetCustomAttributes(typeof(CmdletAttribute), false)[0]; foreach (object obj in enumerable) { CmdletAttribute cmdletAttribute = (CmdletAttribute)obj; DDIValidCommandTextAttribute.cmdlets.Add((cmdletAttribute.VerbName + "-" + cmdletAttribute.NounName).ToUpper()); } }
protected void InitializeSnapIn() { CmdletAssemblyHelper.LoadingAllCmdletAssembliesAndReference(AppDomain.CurrentDomain.BaseDirectory, new string[0]); this.SnapIn.Initialize(this.ProgressProvider); }