private void EnterpriseToEnterpriseProtectionProfileObject()
{
if (string.Compare(this.ReplicationProvider, Constants.HyperVReplica, StringComparison.OrdinalIgnoreCase) != 0)
{
throw new InvalidOperationException(
string.Format(
Properties.Resources.IncorrectReplicationProvider,
this.ReplicationProvider));
}
PSRecoveryServicesClient.ValidateReplicationStartTime(this.ReplicationStartTime);
ushort replicationFrequencyInSeconds = PSRecoveryServicesClient.ConvertReplicationFrequencyToUshort(this.ReplicationFrequencyInSeconds);
ASRProtectionProfile protectionProfile = new ASRProtectionProfile()
{
Name = this.Name,
ReplicationProvider = this.ReplicationProvider,
HyperVReplicaAzureProviderSettingsObject = null,
HyperVReplicaProviderSettingsObject = new HyperVReplicaProviderSettings()
{
ReplicationMethod = this.ReplicationMethod,
ReplicationFrequencyInSeconds = replicationFrequencyInSeconds,
RecoveryPoints = this.RecoveryPoints,
ApplicationConsistentSnapshotFrequencyInHours = this.ApplicationConsistentSnapshotFrequencyInHours,
CompressionEnabled = this.CompressionEnabled,
ReplicationPort = this.ReplicationPort,
Authentication = this.Authentication,
ReplicationStartTime = this.ReplicationStartTime,
AllowReplicaDeletion = this.AllowReplicaDeletion
}
};
this.WriteObject(protectionProfile);
}
}