Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

avoid breaking customer experience #15125

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/ResourceGraph/ResourceGraph/Cmdlets/SearchAzureRmGraph.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace Microsoft.Azure.Commands.ResourceGraph.Cmdlets
/// Search-AzGraph cmdlet
/// </summary>
/// <seealso cref="Microsoft.Azure.Commands.ResourceGraph.Utilities.ResourceGraphBaseCmdlet" />
[Cmdlet(VerbsCommon.Search, ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "Graph", DefaultParameterSetName = "SubscriptionScopedQuery"), OutputType(typeof(PSResourceGraphResponse))]
[Cmdlet(VerbsCommon.Search, ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "Graph", DefaultParameterSetName = "SubscriptionScopedQuery"), OutputType(typeof(PSResourceGraphResponse<PSObject>))]
public class SearchAzureRmGraph : ResourceGraphBaseCmdlet
{
/// <summary>
Expand Down Expand Up @@ -160,7 +160,7 @@ public override void ExecuteCmdlet()
}
}

var psResourceGraphResponse = new PSResourceGraphResponse();
var psResourceGraphResponse = new PSResourceGraphResponse<PSObject>();
QueryResponse response = null;

var resultTruncated = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,53 @@

namespace Microsoft.Azure.Commands.ResourceGraph.Models
{
using System;
using System.Collections;
using System.Collections.Generic;
using System.Management.Automation;
using Microsoft.WindowsAzure.Commands.Common.Attributes;

public class PSResourceGraphResponse
public class PSResourceGraphResponse<PSObject> : IList<PSObject>
{

[Ps1Xml(Target = ViewControl.List)]
public string SkipToken { get; set; }

[Ps1Xml(Target = ViewControl.List)]
public IList<PSObject> Data { get; set; }

public PSObject this[int index] { get => Data[index]; set => Data[index] = value; }

public IEnumerator<PSObject> GetEnumerator()
{
return Data.GetEnumerator();
}

IEnumerator IEnumerable.GetEnumerator()
{
return GetEnumerator();
}

public bool IsReadOnly => Data.IsReadOnly;

public int Count => Data.Count;

public void Add(PSObject value) => Data.Add(value);

public void Clear() => Data.Clear();

public bool Contains(PSObject value) => Data.Contains(value);

public void CopyTo(PSObject[] array, int index) => Data.CopyTo(array, index);

public int IndexOf(PSObject value) => Data.IndexOf(value);

public void Insert(int index, PSObject value) => Data.Insert(index, value);

public void Remove(PSObject value) => Data.Remove(value);

public void RemoveAt(int index) => Data.RemoveAt(index);

bool ICollection<PSObject>.Remove(PSObject item) => Data.Remove(item);
}
}