protected override void ProcessRecordInternal() { var result = new PSLogProfileCollection(); if (string.IsNullOrWhiteSpace(this.Name)) { IEnumerable<LogProfileResource> resultList = this.InsightsManagementClient.LogProfiles.ListAsync(cancellationToken: CancellationToken.None).Result; result.AddRange(resultList.Select(x => new PSLogProfile(logProfile: x))); } else { LogProfileResource logProfile = this.InsightsManagementClient.LogProfiles.GetAsync(logProfileName: this.Name, cancellationToken: CancellationToken.None).Result; result.Add(new PSLogProfile(logProfile: logProfile)); } WriteObject(result); }
protected override void ProcessRecordInternal() { var result = new PSLogProfileCollection(); if (string.IsNullOrWhiteSpace(this.Name)) { LogProfileListResponse resultList = this.InsightsManagementClient.LogProfilesOperations.ListAsync(CancellationToken.None).Result; result.AddRange(resultList.LogProfileCollection.Value.Select(x => new PSLogProfile(x.Id, x.Name, x.Properties))); } else { LogProfileGetResponse logProfiles = this.InsightsManagementClient.LogProfilesOperations.GetAsync(this.Name, CancellationToken.None).Result; var psResult = new PSLogProfile(logProfiles.Id, this.Name, logProfiles.Properties); result.Add(psResult); } WriteObject(result); }
protected override void ProcessRecordInternal() { var result = new PSLogProfileCollection(); if (string.IsNullOrWhiteSpace(this.Name)) { IEnumerable <LogProfileResource> resultList = this.InsightsManagementClient.LogProfiles.ListAsync(cancellationToken: CancellationToken.None).Result; result.AddRange(resultList.Select(x => new PSLogProfile(logProfile: x))); } else { LogProfileResource logProfile = this.InsightsManagementClient.LogProfiles.GetAsync(logProfileName: this.Name, cancellationToken: CancellationToken.None).Result; result.Add(new PSLogProfile(logProfile: logProfile)); } WriteObject(result); }