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-GSDrive should allow both -DriveId and -UseDomainAdminAccess parameters #330

Open MattPennerVVUSD opened 3 years ago

MattPennerVVUSD commented 3 years ago

Sometimes you may have the DriveId for a shared drive you would like info on, but are not a member of.

Right now using both the DriveId and UseDomainAdminAccess parameters are not allowed. Intellisense clearly does not prompt you the instant you add -DriveId. If you attempt to do so anyway you get the following error:

Get-GSDrive  -User user@domain.com -DriveId ValidGoogleDriveId -UseDomainAdminAccess

Get-GSDrive : Parameter set cannot be resolved using the specified named parameters.
At line:1 char:1
+ Get-GSDrive  -User user@domain.com -DriveId ValidGoogleDriveId...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [Get-GSDrive], ParameterBindingException
    + FullyQualifiedErrorId : AmbiguousParameterSet,Get-GSDrive

Using the Drives Google API Explorer this works just fine so it is an allowable call.