SCRT-HQ / PSGSuite

Powershell module for Google / G Suite API calls wrapped in handy functions. Authentication is established using a service account via P12 key to negate the consent popup and allow for greater handsoff automation capabilities
https://psgsuite.io/
Apache License 2.0
235 stars 67 forks source link

Get-GSDriveFileList limits pagesize to 100 #175

Open WJurecki opened 5 years ago

WJurecki commented 5 years ago

Get-GSDriveFileList limits pagesize to 100 even when higher limits are specified. Also, documentation indicates a default pagesize of 1,000 but 100 is actually used.

Pagesizes lower than 100 are honored.

image

PSVersion: 5.1.17134.407
PSEdition: Desktop OS: Windows 10 Version 1803, Build 17134.472 PSGSuite: 2.26.0

scrthq commented 5 years ago

Hey @WJurecki - I think this may be more of a bug with either the Drive .NET SDK or the API documentation. I'll update to the latest SDK version with the next release and sanity check the code in case something is reverting there.

scrthq commented 5 years ago

Latest Drive .NET SDK and same issue. Confirmed that there's nothing in the code that's hard setting it @ 100 as well.

image

image

Confirmed that the .NET SDK documentation also reflects a maximum of 1000: https://developers.google.com/resources/api-libraries/documentation/drive/v3/csharp/latest/classGoogle_1_1Apis_1_1Drive_1_1v3_1_1FilesResource_1_1ListRequest.html#adca04399178ff49134b8a8e3c4537847

scrthq commented 5 years ago

Going to see about opening up an issue with Google on it, just finding the appropriate spot.

It doesn't appear to be an issue when going through the REST API via the API Explorer; downloaded JSON results confirms 1000 files per page:

image

WJurecki commented 5 years ago

I have tried this again with version 2.27.0 and find that there is a relationship between the number of -Fields requested and the actual -PageSize used, as seen here:

image

scrthq commented 5 years ago

That is pretty strange! Thanks for investigating, @WJurecki!