예제 #1
0
        /// <summary>
        /// Queries all / by default.
        /// </summary>
        private void GetAll()
        {
            ProtectionProfileListResponse profileListResponse =
                RecoveryServicesClient.GetAzureSiteRecoveryProtectionProfile();

            this.WriteProfiles(profileListResponse.ProtectionProfiles);
        }
예제 #2
0
        /// <summary>
        /// Queries by Friendly name.
        /// </summary>
        private void GetByFriendlyName()
        {
            ProtectionProfileListResponse profileListResponse =
                RecoveryServicesClient.GetAzureSiteRecoveryProtectionProfile();

            foreach (ProtectionProfile profile in profileListResponse.ProtectionProfiles)
            {
                if (0 == string.Compare(this.FriendlyName, profile.CustomData.FriendlyName, true))
                {
                    this.WriteProfile(profile);
                }
            }
        }
예제 #3
0
        /// <summary>
        /// Queries by Friendly name.
        /// </summary>
        private void GetByFriendlyName()
        {
            ProtectionProfileListResponse profileListResponse =
                RecoveryServicesClient.GetAzureSiteRecoveryProtectionProfile();
            bool found = false;

            foreach (ProtectionProfile profile in profileListResponse.ProtectionProfiles)
            {
                if (0 == string.Compare(this.FriendlyName, profile.CustomData.FriendlyName, true))
                {
                    this.WriteProfile(profile);
                    found = true;
                }
            }

            if (!found)
            {
                throw new InvalidOperationException(
                          string.Format(
                              Properties.Resources.ProtectionProfileNotFound,
                              this.FriendlyName,
                              PSRecoveryServicesClient.asrVaultCreds.ResourceName));
            }
        }