private void GetByName()
{
try
{
var protectionContainerResponse = RecoveryServicesClient.GetAzureSiteRecoveryProtectionContainer(this.Fabric.Name, this.Name);
if (protectionContainerResponse.ProtectionContainer != null)
{
this.WriteProtectionContainer(protectionContainerResponse.ProtectionContainer);
}
}
catch (CloudException ex)
{
if (string.Compare(ex.Error.Code, "NotFound", StringComparison.OrdinalIgnoreCase) == 0)
{
throw new InvalidOperationException(
string.Format(
Properties.Resources.ProtectionContainerNotFound,
this.Name,
PSRecoveryServicesClient.asrVaultCreds.ResourceName));
}
else
{
throw;
}
}
}