Microsoft.Azure.Commands.Insights.Autoscale.GetAzureRmAutoscaleSettingCommand.ProcessRecordInternal C# (CSharp) Method

ProcessRecordInternal() protected method

Execute the cmdlet
protected ProcessRecordInternal ( ) : void
return void
        protected override void ProcessRecordInternal()
        {
            if (string.IsNullOrWhiteSpace(this.Name))
            {
                // Retrieve all the Autoscale settings for a resource group
                IPage<AutoscaleSettingResource> result = this.InsightsManagementClient.AutoscaleSettings.ListByResourceGroupAsync(resourceGroupName: this.ResourceGroup).Result;

                var records = result.Select(e => this.DetailedOutput.IsPresent ? new PSAutoscaleSetting(e) : e);
                WriteObject(sendToPipeline: records, enumerateCollection: true);
            }
            else
            {
                // Retrieve a single Autoscale setting determined by the resource group and the rule name
                AutoscaleSettingResource result = this.InsightsManagementClient.AutoscaleSettings.GetAsync(resourceGroupName: this.ResourceGroup, autoscaleSettingName: this.Name).Result;

                WriteObject(sendToPipeline: this.DetailedOutput.IsPresent ? new PSAutoscaleSetting(result) : result);
            }
        }
    }
GetAzureRmAutoscaleSettingCommand