/// <summary> /// Syncs the collections on a PSPoolSpecification with its wrapped OM object /// </summary> internal static void PoolSpecificationSyncCollections(PSPoolSpecification spec) { if (spec != null) { spec.omObject.CertificateReferences = CreateSyncedList(spec.CertificateReferences, (c) => { ICertificateReference certReference = new CertificateReference(); certReference.StoreLocation = c.StoreLocation; certReference.StoreName = c.StoreName; certReference.Thumbprint = c.Thumbprint; certReference.ThumbprintAlgorithm = c.ThumbprintAlgorithm; certReference.Visibility = c.Visibility; return(certReference); }); spec.omObject.Metadata = CreateSyncedList(spec.Metadata, (m) => { IMetadataItem metadata = new MetadataItem(m.Name, m.Value); return(metadata); }); if (spec.StartTask != null) { StartTaskSyncCollections(spec.StartTask); } } }
/// <summary> /// Syncs the collections on a PSPoolSpecification with its wrapped OM object /// </summary> internal static void PoolSpecificationSyncCollections(PSPoolSpecification spec) { if (spec != null) { spec.omObject.CertificateReferences = CreateSyncedList(spec.CertificateReferences, (c) => { return(ConvertCertificateReference(c)); }); spec.omObject.Metadata = CreateSyncedList(spec.Metadata, (m) => { MetadataItem metadata = new MetadataItem(m.Name, m.Value); return(metadata); }); spec.omObject.ApplicationPackageReferences = CreateSyncedList(spec.ApplicationPackageReferences, (apr) => { return(new ApplicationPackageReference() { ApplicationId = apr.ApplicationId, Version = apr.Version }); }); if (spec.StartTask != null) { StartTaskSyncCollections(spec.StartTask); } } }
/// <summary> /// Syncs the collections on a PSPoolSpecification with its wrapped OM object /// </summary> internal static void PoolSpecificationSyncCollections(PSPoolSpecification spec) { if (spec != null) { spec.omObject.CertificateReferences = CreateSyncedList(spec.CertificateReferences, (c) => { return(ConvertCertificateReference(c)); }); spec.omObject.Metadata = CreateSyncedList(spec.Metadata, (m) => { MetadataItem metadata = new MetadataItem(m.Name, m.Value); return(metadata); }); spec.omObject.ApplicationPackageReferences = CreateSyncedList(spec.ApplicationPackageReferences, (apr) => { return(new ApplicationPackageReference() { ApplicationId = apr.ApplicationId, Version = apr.Version }); }); spec.omObject.UserAccounts = CreateSyncedList(spec.UserAccounts, (user) => { return(new UserAccount( user.Name, user.Password, user.ElevationLevel, user.LinuxUserConfiguration?.omObject)); }); if (spec.StartTask != null) { StartTaskSyncCollections(spec.StartTask); } } }