예제 #1
0
 protected override void ProcessRecord(IEnumerable <Database> databases)
 {
     if (String.IsNullOrEmpty(Name))
     {
         foreach (var database in databases)
         {
             WriteObject(ArchiveManager.GetArchives(database), true);
         }
     }
     else
     {
         foreach (var database in databases)
         {
             WildcardWrite(Name, ArchiveManager.GetArchives(database), archive => archive.Name);
         }
     }
 }
예제 #2
0
        protected override void ProcessRecord(IEnumerable <Database> databases)
        {
            foreach (var database in databases)
            {
                var archives         = ArchiveManager.GetArchives(database);
                var extendedArchives = new List <PSObject>();
                foreach (var archive in archives)
                {
                    var extendedArchive = new PSObject(archive);
                    extendedArchive.Properties.Add(new PSNoteProperty("Database", database));
                    extendedArchives.Add(extendedArchive);
                }

                if (string.IsNullOrEmpty(Name))
                {
                    WriteObject(extendedArchives, true);
                }
                else
                {
                    WildcardWrite(Name, extendedArchives, archive => ((Archive)archive.BaseObject).Name);
                }
            }
        }