PSCustomObject with pages - page limit set to 25

183 views Asked by At

I use Invoke-RestMethod to retrieve metadata about a bunch of documents in a folder via a REST API. While the method returns all the data in a PSCustomObject, I can't figure out how to access all of it. The custom object has the properties "page", "page_total", "limit" (all System.Int32) and "data" (System.Object[]), as shown below.

There are 2 pages, since the "data" "limit" is 25 per page, but there are 30 "data" entries total. How can I access the 5 data entries on page 2? I don't even know where to start, since I don't have any experience with PSCustomObjects.

Thanks in advance!

 TypeName: System.Management.Automation.PSCustomObject

Name              MemberType   Definition                                                                                                                                                             
----              ----------   ----------                                                                                                                                                             
Equals            Method       bool Equals(System.Object obj)                                                                                                                                         
GetHashCode       Method       int GetHashCode()                                                                                                                                                      
GetType           Method       type GetType()                                                                                                                                                         
ToString          Method       string ToString()                                                                                                                                                      
data              NoteProperty System.Object[] data=System.Object[]                                                                                                                                   
definitions       NoteProperty System.Management.Automation.PSCustomObject definitions=@{create_date=; create_user_id=; description=; favorite=; icon=; id=; mime_type=; modify_date=; modify_user_...
definitions_map   NoteProperty System.Management.Automation.PSCustomObject definitions_map=@{name=System.Object[]}                                                                                    
definitions_order NoteProperty System.Object[] definitions_order=System.Object[]                                                                                                                      
limit             NoteProperty System.Int32 limit=25                                                                                                                                                  
page              NoteProperty System.Int32 page=2                                                                                                                                                    
page_total        NoteProperty System.Int32 page_total=2                                                                                                                                              
range_max         NoteProperty System.Int32 range_max=25                                                                                                                                              
range_min         NoteProperty System.Int32 range_min=1                                                                                                                                               
sort              NoteProperty System.String sort=asc_name                                                                                                                                            
total_count       NoteProperty System.Int32 total_count=30                                                                                                                                            
where_facet       NoteProperty System.Object[] where_facet=System.Object[]                                                                                                                            
where_name        NoteProperty System.String where_name=                                                                                                                                              
where_type        NoteProperty System.Object[] where_type=System.Object[]
0

There are 0 answers