private void GetByFriendlyName()
{
ProtectionContainerListResponse protectionContainerListResponse;
bool found = false;
protectionContainerListResponse =
RecoveryServicesClient.GetAzureSiteRecoveryProtectionContainer(this.Fabric.Name);
foreach (
ProtectionContainer protectionContainer in
protectionContainerListResponse.ProtectionContainers)
{
if (0 == string.Compare(this.FriendlyName, protectionContainer.Properties.FriendlyName, StringComparison.OrdinalIgnoreCase))
{
var protectionContainerByName = RecoveryServicesClient.GetAzureSiteRecoveryProtectionContainer(this.Fabric.Name, protectionContainer.Name).ProtectionContainer;
WriteProtectionContainer(protectionContainerByName);
found = true;
}
}
if (!found)
{
throw new InvalidOperationException(
string.Format(
Properties.Resources.ProtectionContainerNotFound,
FriendlyName,
PSRecoveryServicesClient.asrVaultCreds.ResourceName));
}
}