@@ -107,59 +107,10 @@ public class CreateAzureSiteRecoveryProtectionProfileObject : RecoveryServicesCm
107
107
/// <summary>
108
108
/// Gets or sets Replication Start time of the Protection Profile.
109
109
/// </summary>
110
- [ Parameter ( ParameterSetName = ASRParameterSets . EnterpriseToEnterprise , Mandatory = true ) ]
111
- [ Parameter ( ParameterSetName = ASRParameterSets . EnterpriseToAzure , Mandatory = true ) ]
110
+ [ Parameter ( ParameterSetName = ASRParameterSets . EnterpriseToEnterprise ) ]
111
+ [ Parameter ( ParameterSetName = ASRParameterSets . EnterpriseToAzure ) ]
112
112
[ ValidateNotNullOrEmpty ]
113
- [ ValidateSet (
114
- "Immediately" ,
115
- "12:30 AM" ,
116
- "1:00 AM" ,
117
- "1:30 AM" ,
118
- "2:00 AM" ,
119
- "2:30 AM" ,
120
- "3:00 AM" ,
121
- "3:30 AM" ,
122
- "4:00 AM" ,
123
- "4:30 AM" ,
124
- "5:00 AM" ,
125
- "5:30 AM" ,
126
- "6:00 AM" ,
127
- "6:30 AM" ,
128
- "7:00 AM" ,
129
- "7:30 AM" ,
130
- "8:00 AM" ,
131
- "8:30 AM" ,
132
- "9:00 AM" ,
133
- "9:30 AM" ,
134
- "10:00 AM" ,
135
- "10:30 AM" ,
136
- "11:00 AM" ,
137
- "11:30 AM" ,
138
- "12:00 PM" ,
139
- "12:30 PM" ,
140
- "1:00 PM" ,
141
- "1:30 PM" ,
142
- "2:00 PM" ,
143
- "2:30 PM" ,
144
- "3:00 PM" ,
145
- "3:30 PM" ,
146
- "4:00 PM" ,
147
- "4:30 PM" ,
148
- "5:00 PM" ,
149
- "5:30 PM" ,
150
- "6:00 PM" ,
151
- "6:30 PM" ,
152
- "7:00 PM" ,
153
- "7:30 PM" ,
154
- "8:00 PM" ,
155
- "8:30 PM" ,
156
- "9:00 PM" ,
157
- "9:30 PM" ,
158
- "10:00 PM" ,
159
- "10:30 PM" ,
160
- "11:00 PM" ,
161
- "11:30 PM" ) ]
162
- public string ReplicationStartTime { get ; set ; }
113
+ public TimeSpan ? ReplicationStartTime { get ; set ; }
163
114
164
115
/// <summary>
165
116
/// Gets or sets a value indicating whether Replica should be Deleted on
@@ -216,9 +167,6 @@ private void EnterpriseToAzureProtectionProfileObject()
216
167
// Verify whether the subscription is associated with the account or not.
217
168
PSRecoveryServicesClientHelper . ValidateSubscriptionAccountAssociation ( this . RecoveryAzureSubscription ) ;
218
169
219
- // Change the Replication Start Time given from string to TimeSpan
220
- TimeSpan ? timeSpan = PSRecoveryServicesClientHelper . ConvertIntoTimeSpan ( this . ReplicationStartTime ) ;
221
-
222
170
ASRProtectionProfile protectionProfile = new ASRProtectionProfile ( )
223
171
{
224
172
ReplicationProvider = this . ReplicationProvider ,
@@ -232,7 +180,7 @@ private void EnterpriseToAzureProtectionProfileObject()
232
180
ApplicationConsistentSnapshotFrequencyInHours = this . ApplicationConsistentSnapshotFrequencyInHours ,
233
181
CompressionEnabled = this . CompressionEnabled ,
234
182
ReplicationPort = this . ReplicationPort ,
235
- ReplicationStartTime = timeSpan ,
183
+ ReplicationStartTime = this . ReplicationStartTime ,
236
184
AllowReplicaDeletion = this . AllowReplicaDeletion
237
185
} ,
238
186
HyperVReplicaProviderSettingsObject = null
@@ -246,9 +194,6 @@ private void EnterpriseToAzureProtectionProfileObject()
246
194
/// </summary>
247
195
private void EnterpriseToEnterpriseProtectionProfileObject ( )
248
196
{
249
- // Change the Replication Start Time given from string to TimeSpan
250
- TimeSpan ? timeSpan = PSRecoveryServicesClientHelper . ConvertIntoTimeSpan ( this . ReplicationStartTime ) ;
251
-
252
197
ASRProtectionProfile protectionProfile = new ASRProtectionProfile ( )
253
198
{
254
199
ReplicationProvider = this . ReplicationProvider ,
@@ -261,7 +206,7 @@ private void EnterpriseToEnterpriseProtectionProfileObject()
261
206
ApplicationConsistentSnapshotFrequencyInHours = this . ApplicationConsistentSnapshotFrequencyInHours ,
262
207
CompressionEnabled = this . CompressionEnabled ,
263
208
ReplicationPort = this . ReplicationPort ,
264
- ReplicationStartTime = timeSpan ,
209
+ ReplicationStartTime = this . ReplicationStartTime ,
265
210
AllowReplicaDeletion = this . AllowReplicaDeletion
266
211
}
267
212
} ;
0 commit comments