@@ -110,7 +110,56 @@ public class CreateAzureSiteRecoveryProtectionProfileObject : RecoveryServicesCm
110
110
[ Parameter ( ParameterSetName = ASRParameterSets . EnterpriseToEnterprise , Mandatory = true ) ]
111
111
[ Parameter ( ParameterSetName = ASRParameterSets . EnterpriseToAzure , Mandatory = true ) ]
112
112
[ ValidateNotNullOrEmpty ]
113
- public TimeSpan ? ReplicationStartTime { get ; set ; }
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 ; }
114
163
115
164
/// <summary>
116
165
/// Gets or sets a value indicating whether Replica should be Deleted on
@@ -167,6 +216,9 @@ private void EnterpriseToAzureProtectionProfileObject()
167
216
// Verify whether the subscription is associated with the account or not.
168
217
PSRecoveryServicesClientHelper . ValidateSubscriptionAccountAssociation ( this . RecoveryAzureSubscription ) ;
169
218
219
+ // Change the Replication Start Time given from string to TimeSpan
220
+ TimeSpan ? timeSpan = PSRecoveryServicesClientHelper . ConvertIntoTimeSpan ( this . ReplicationStartTime ) ;
221
+
170
222
ASRProtectionProfile protectionProfile = new ASRProtectionProfile ( )
171
223
{
172
224
ReplicationProvider = this . ReplicationProvider ,
@@ -178,7 +230,7 @@ private void EnterpriseToAzureProtectionProfileObject()
178
230
ApplicationConsistentSnapshotFrequencyInHours = this . ApplicationConsistentSnapshotFrequencyInHours ,
179
231
CompressionEnabled = this . CompressionEnabled ,
180
232
ReplicationPort = this . ReplicationPort ,
181
- ReplicationStartTime = this . ReplicationStartTime ,
233
+ ReplicationStartTime = timeSpan ,
182
234
AllowReplicaDeletion = this . AllowReplicaDeletion
183
235
} ;
184
236
@@ -190,6 +242,9 @@ private void EnterpriseToAzureProtectionProfileObject()
190
242
/// </summary>
191
243
private void EnterpriseToEnterpriseProtectionProfileObject ( )
192
244
{
245
+ // Change the Replication Start Time given from string to TimeSpan
246
+ TimeSpan ? timeSpan = PSRecoveryServicesClientHelper . ConvertIntoTimeSpan ( this . ReplicationStartTime ) ;
247
+
193
248
ASRProtectionProfile protectionProfile = new ASRProtectionProfile ( )
194
249
{
195
250
ReplicationProvider = this . ReplicationProvider ,
@@ -201,7 +256,7 @@ private void EnterpriseToEnterpriseProtectionProfileObject()
201
256
ApplicationConsistentSnapshotFrequencyInHours = this . ApplicationConsistentSnapshotFrequencyInHours ,
202
257
CompressionEnabled = this . CompressionEnabled ,
203
258
ReplicationPort = this . ReplicationPort ,
204
- ReplicationStartTime = this . ReplicationStartTime ,
259
+ ReplicationStartTime = timeSpan ,
205
260
AllowReplicaDeletion = this . AllowReplicaDeletion
206
261
} ;
207
262
0 commit comments