示例#1
0
        public void Update(PSModuleValidation item)
        {
            if (!this.ModuleName.Equals(item.ModuleName, StringComparison.OrdinalIgnoreCase))
            {
                throw new InvalidOperationException("The reference item contains information about another module.");
            }

            this.ModuleInfo           = item.ModuleInfo;
            this.IsModule             = item.IsModule;
            this.IsVersionValid       = item.IsVersionValid;
            this.IsNewVersion         = item.IsNewVersion;
            this.SupportVersonControl = item.SupportVersonControl;
            this.IsReadyForPackaging  = item.IsReadyForPackaging;
        }
示例#2
0
        internal PSModuleValidation[] GetInternalDependencies()
        {
            if (this.ModuleInfo == null)
            {
                return(new PSModuleValidation[0]);
            }
            if (this.ModuleInfo.RequiredModules == null || this.ModuleInfo.RequiredModules.Count == 0)
            {
                return(new PSModuleValidation[0]);
            }

            var depModuleNames = this.ModuleInfo.RequiredModules.Select(rm => rm.Name).ToArray();
            var depModules     = ParentCollection.AllModuleNames.Intersect(depModuleNames, StringComparer.OrdinalIgnoreCase).ToArray();

            var res = new PSModuleValidation[depModules.Length];

            for (int i = 0; i < res.Length; i++)
            {
                res[i] = ParentCollection[depModules[i]];
            }
            return(res);
        }