Skip to content

Commit 27865be

Browse files
committed
Merge pull request #287 from MabOneSdk/dev1-sudreddy
Added Backup word in removePolicy cmdlet and test case change
2 parents c544d65 + 5f98784 commit 27865be

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

src/ResourceManager/RecoveryServices.Backup/Commands.RecoveryServices.Backup.Test/ScenarioTests/IaasVm/PolicyTests.ps1

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,27 @@ function Test-PolicyScenario
1919

2020
# get default objects
2121
$schedulePolicy = Get-AzureRmRecoveryServicesBackupSchedulePolicyObject -WorkloadType "AzureVM"
22+
Assert-NotNull $schedulePolicy
2223
$retPolicy = Get-AzureRmRecoveryServicesBackupRetentionPolicyObject -WorkloadType "AzureVM"
24+
Assert-NotNull $retPolicy
2325

2426
# now create new policy
2527
$policy = New-AzureRmRecoveryServicesBackupProtectionPolicy -Name "pwtest1" -WorkloadType "AzureVM" -RetentionPolicy $retPolicy -SchedulePolicy $schedulePolicy
28+
Assert-NotNull $policy
29+
Assert-AreEqual $policy.Name "pwtest1"
2630

2731
# now get policy and update it with new schedule/retention
2832
$schedulePolicy = Get-AzureRmRecoveryServicesBackupSchedulePolicyObject -WorkloadType "AzureVM"
33+
Assert-NotNull $schedulePolicy
2934
$retPolicy = Get-AzureRmRecoveryServicesBackupRetentionPolicyObject -WorkloadType "AzureVM"
35+
Assert-NotNull $retPolicy
3036

3137
$temp = Get-AzureRmRecoveryServicesBackupProtectionPolicy -Name "pwtest1"
32-
Set-AzureRmRecoveryServicesBackupProtectionPolicy -RetentionPolicy $retPolicy -SchedulePolicy $schedulePolicy -Policy $temp
38+
Assert-NotNull $temp
39+
Assert-AreEqual $temp.Name "pwtest1"
40+
41+
Set-AzureRmRecoveryServicesBackupProtectionPolicy -RetentionPolicy $retPolicy -SchedulePolicy $schedulePolicy -Policy $temp
3342

3443
#cleanup
35-
Remove-AzureRmRecoveryServicesProtectionPolicy -Policy $temp -Force
44+
Remove-AzureRmRecoveryServicesBackupProtectionPolicy -Policy $temp -Force
3645
}

src/ResourceManager/RecoveryServices.Backup/Commands.RecoveryServices.Backup/Cmdlets/ProtectionPolicy/RemoveAzureRmRecoveryServicesPolicy.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ namespace Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets
2929
/// <summary>
3030
/// Update existing protection policy
3131
/// </summary>
32-
[Cmdlet(VerbsCommon.Remove, "AzureRmRecoveryServicesProtectionPolicy", DefaultParameterSetName = PolicyNameParameterSet)]
32+
[Cmdlet(VerbsCommon.Remove, "AzureRmRecoveryServicesBackupProtectionPolicy", DefaultParameterSetName = PolicyNameParameterSet)]
3333
public class RemoveAzureRmRecoveryServicesProtectionPolicy : RecoveryServicesBackupCmdletBase
3434
{
3535
internal const string PolicyNameParameterSet = "PolicyName";

0 commit comments

Comments
 (0)