public override void ExecuteCmdlet()
        {
            base.ExecuteCmdlet();
            ExecuteClientAction(() =>
            {
                string resourceGroupName = this.ResourceGroupName;
                string name = this.Name;

                if (!string.IsNullOrEmpty(resourceGroupName) && !string.IsNullOrEmpty(name))
                {
                    var result = MaintenanceConfigurationsClient.Get(resourceGroupName, name);
                    WriteObject(result);
                }

                else
                {
                    var psObject = new List <PSMaintenanceConfiguration>();
                    var result   = MaintenanceConfigurationsClient.List();

                    foreach (var maintenanceConfiguration in result)
                    {
                        PSMaintenanceConfiguration psMaintenanceConfiguration = new PSMaintenanceConfiguration();
                        MaintenanceAutomationAutoMapperProfile.Mapper.Map <MaintenanceConfiguration, PSMaintenanceConfiguration>(maintenanceConfiguration, psMaintenanceConfiguration);
                        psObject.Add(psMaintenanceConfiguration);
                    }

                    WriteObject(psObject);
                }
            });
        }
        public override void ExecuteCmdlet()
        {
            base.ExecuteCmdlet();
            ExecuteClientAction(() =>
            {
                string resourceGroupName = this.ResourceGroupName;
                string name = this.Name;
                if (!string.IsNullOrEmpty(resourceGroupName) && !string.IsNullOrEmpty(name))
                {
                    var result = MaintenanceConfigurationsClient.Get(resourceGroupName, name);
                    PSMaintenanceConfiguration psMaintenanceConfiguration = new PSMaintenanceConfiguration();
                    MaintenanceAutomationAutoMapperProfile.Mapper.Map <MaintenanceConfiguration, PSMaintenanceConfiguration>(result, psMaintenanceConfiguration);
                    WriteObject(psMaintenanceConfiguration);
                }

                else
                {
                    var psObject = new List <PSMaintenanceConfiguration>();
                    var result   = MaintenanceConfigurationsClient.List();

                    foreach (var maintenanceConfiguration in result)
                    {
                        string[] mcInfo = maintenanceConfiguration.Id.Split(uriSplit, StringSplitOptions.RemoveEmptyEntries);
                        if (null != mcInfo && mcInfo.Length == 8)
                        {
                            if (!string.IsNullOrEmpty(resourceGroupName) && !mcInfo[3].Equals(resourceGroupName))
                            {
                                continue;
                            }

                            if (!string.IsNullOrEmpty(name) && !maintenanceConfiguration.Name.Equals(name))
                            {
                                continue;
                            }
                        }

                        PSMaintenanceConfiguration psMaintenanceConfiguration = new PSMaintenanceConfiguration();
                        MaintenanceAutomationAutoMapperProfile.Mapper.Map <MaintenanceConfiguration, PSMaintenanceConfiguration>(maintenanceConfiguration, psMaintenanceConfiguration);
                        psObject.Add(psMaintenanceConfiguration);
                    }

                    WriteObject(psObject);
                }
            });
        }