Example #1
0
        protected override void ProcessRecord()
        {
            base.ProcessRecord();

            base.WriteVerbose(string.Format("Reading Solution Zip: {0}", SolutionFilePath));

            string uniqueName;
            string version;

            using (ZipArchive solutionZip = ZipFile.Open(SolutionFilePath, ZipArchiveMode.Read))
            {
                ZipArchiveEntry solutionEntry = solutionZip.GetEntry("solution.xml");

                using (var reader = new StreamReader(solutionEntry.Open()))
                {
                    XElement solutionNode = XElement.Load(reader);
                    uniqueName = solutionNode.Descendants("UniqueName").First().Value;
                    version    = solutionNode.Descendants("Version").First().Value;
                }
            }

            var info = new XrmSolutionInfo
            {
                UniqueName = uniqueName,
                Version    = version
            };

            base.WriteObject(info);
        }
Example #2
0
        protected override void ProcessRecord()
        {
            base.ProcessRecord();

            base.WriteVerbose(string.Format("Reading Solution Files Folder: {0}", SolutionFilesFolderPath));

            string uniqueName;
            string version;

            using (var reader = new StreamReader(SolutionFilesFolderPath + "\\Other\\Solution.xml"))
            {
                XElement solutionNode = XElement.Load(reader);
                uniqueName = solutionNode.Descendants("UniqueName").First().Value;
                version    = solutionNode.Descendants("Version").First().Value;
            }

            var info = new XrmSolutionInfo
            {
                UniqueName = uniqueName,
                Version    = version
            };

            base.WriteObject(info);
        }