public override void ExecuteCmdlet()
        {
            var result = CdnManagementClient.CheckNameAvailability(EndpointName);

            WriteVerbose(Resources.Success);
            WriteObject(result.ToPsCheckNameAvailabilityOutput());
        }
        public override void ExecuteCmdlet()
        {
            if (ParameterSetName == ObjectParameterSet)
            {
                ProfileName       = CdnProfile.Name;
                ResourceGroupName = CdnProfile.ResourceGroupName;
                Location          = CdnProfile.Location;
            }

            var checkExists = CdnManagementClient.CheckNameAvailability(EndpointName);

            if (!checkExists.NameAvailable.Value)
            {
                throw new PSArgumentException(string.Format(
                                                  Resources.Error_CreateExistingEndpoint,
                                                  EndpointName));
            }

            ConfirmAction(MyInvocation.InvocationName,
                          EndpointName,
                          () => NewEndpoint());
        }