diff --git a/src/ResourceManager/AzureBackup/Commands.AzureBackup.Test/ScenarioTests/AzureBackupTests.ps1 b/src/ResourceManager/AzureBackup/Commands.AzureBackup.Test/ScenarioTests/AzureBackupTests.ps1 index 3ed1a499ab83..e62b5b5c9813 100644 --- a/src/ResourceManager/AzureBackup/Commands.AzureBackup.Test/ScenarioTests/AzureBackupTests.ps1 +++ b/src/ResourceManager/AzureBackup/Commands.AzureBackup.Test/ScenarioTests/AzureBackupTests.ps1 @@ -52,12 +52,14 @@ function GetAzureRecoveryPointTest $azureBackUpItem.DataSourceId = $DataSourceId $azureBackUpItem.Type = $DataSourceType $recoveryPoints = Get-AzureBackupRecoveryPoint -item $azureBackUpItem - Assert-NotNull $recoveryPoints 'Recovery Points should not be null' - foreach($recoveryPoint in $recoveryPoints) + if (!($recoveryPoints -eq $null)) { - Assert-NotNull $recoveryPoint.RecoveryPointTime 'RecoveryPointTime should not be null' - Assert-NotNull $recoveryPoint.RecoveryPointType 'RecoveryPointType should not be null' - Assert-NotNull $recoveryPoint.RecoveryPointId 'RecoveryPointId should not be null' + foreach($recoveryPoint in $recoveryPoints) + { + Assert-NotNull $recoveryPoint.RecoveryPointTime 'RecoveryPointTime should not be null' + Assert-NotNull $recoveryPoint.RecoveryPointType 'RecoveryPointType should not be null' + Assert-NotNull $recoveryPoint.RecoveryPointId 'RecoveryPointId should not be null' + } } }