Microsoft.Azure.Commands.AnalysisServices.SetAzureAnalysisServicesServer.ExecuteCmdlet C# (CSharp) Method

ExecuteCmdlet() public method

public ExecuteCmdlet ( ) : void
return void
        public override void ExecuteCmdlet()
        {
            if (string.IsNullOrEmpty(Name))
            {
                WriteExceptionError(new PSArgumentNullException("Name", "Name of server not specified"));
            }

            if (ShouldProcess(Name, Resources.UpdatingAnalysisServicesServer))
            {
                AnalysisServicesServer currentServer = null;
                if (!AnalysisServicesClient.TestServer(ResourceGroupName, Name, out currentServer))
                {
                    throw new InvalidOperationException(string.Format(Properties.Resources.ServerDoesNotExist, Name));
                }

                var location = currentServer.Location;
                if (Tag == null && currentServer.Tags != null)
                {
                    Tag = TagsConversionHelper.CreateTagHashtable(currentServer.Tags);
                }

                AnalysisServicesServer updatedServer = AnalysisServicesClient.CreateOrUpdateServer(ResourceGroupName, Name, location, Sku, Tag, Administrator, currentServer);

                if(PassThru.IsPresent)
                {
                    WriteObject(AzureAnalysisServicesServer.FromAnalysisServicesServer(updatedServer));
                }
            }
        }
    }
SetAzureAnalysisServicesServer