/// <summary>
        /// ProcessRecord of the command.
        /// </summary>
        public override void ExecuteCmdlet()
        {
            try
            {
                string primaryServerId  = this.PrimaryServer.ID;
                string recoveryServerId = string.Empty;

                switch (this.ParameterSetName)
                {
                case ASRParameterSets.EnterpriseToEnterprise:
                    recoveryServerId = this.RecoveryServer.ID;
                    break;

                case ASRParameterSets.EnterpriseToAzure:
                    recoveryServerId = Constants.AzureFabricId;
                    break;
                }

                NetworkMappingListResponse networkMappingListResponse =
                    RecoveryServicesClient
                    .GetAzureSiteRecoveryNetworkMappings(primaryServerId, recoveryServerId);

                this.WriteNetworkMappings(networkMappingListResponse.NetworkMappings);
            }
            catch (Exception exception)
            {
                this.HandleException(exception);
            }
        }
예제 #2
0
        /// <summary>
        /// ProcessRecord of the command.
        /// </summary>
        public override void ExecuteCmdlet()
        {
            try
            {
                this.WriteWarningWithTimestamp(
                    string.Format(
                        Properties.Resources.CmdletWillBeDeprecatedSoon,
                        this.MyInvocation.MyCommand.Name));

                string primaryServerId  = this.PrimaryServer.ID;
                string recoveryServerId = string.Empty;

                switch (this.ParameterSetName)
                {
                case ASRParameterSets.EnterpriseToEnterprise:
                    recoveryServerId = this.RecoveryServer.ID;
                    break;

                case ASRParameterSets.EnterpriseToAzure:
                    recoveryServerId = Constants.AzureFabricId;
                    break;
                }

                NetworkMappingListResponse networkMappingListResponse =
                    RecoveryServicesClient
                    .GetAzureSiteRecoveryNetworkMappings(primaryServerId, recoveryServerId);

                this.WriteNetworkMappings(networkMappingListResponse.NetworkMappings);
            }
            catch (Exception exception)
            {
                this.HandleException(exception);
            }
        }