-
Notifications
You must be signed in to change notification settings - Fork 67
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
Additional Reports Since Last Edited #359 #360
base: main
Are you sure you want to change the base?
Conversation
This looks good to me. Just to be clear, you pulled from this list right? I see the REST API has more options but they're not in that list. I did play around with the .Net just a bit:
So first, it looks like the 4 missing values from the API reference are supported by the library, ContextAwareAccess, Chrome, DataStudio, and Keep. Second, since I figured out how to get all the possible values out of the enumeration, I think it might be possible use that to validate dynamically (either putting |
Well, setting the param like this seems to work:
It looks like those 4 missing values are only there in the version of the library that's used in PSCore, the net45 library doesn't have them. I'd say you're fine to leave the help text as is, and update the parameter as above, and then if the library changes, it will still be supported without needing to manually add the new values to the parameter list. I know someday @scrthq would like to drop support for anything below PS 5.1 which would take care of the library inconsistency, but that's a future thing. |
@@ -60,7 +68,7 @@ function Get-GSActivityReport { | |||
[String] | |||
$UserKey = 'all', | |||
[parameter(Mandatory = $false,Position = 1)] | |||
[ValidateSet("Admin","Calendar","Drive","Groups","GPlus","Login","Mobile","Rules","Token")] | |||
[ValidateSet("AccessTransparency","Admin","Calendar","Chat","Drive","Gcp","Gplus","Groups","GroupsEnterprise","Jamboard","Login","Meet","Mobile","Rules","Saml","Token","UserAccounts")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make this ValidateSet Dynamic with this code:
[parameter(Mandatory = $false,Position = 1)]
[ArgumentCompleter(
{
param($Command, $Parameter, $WordToComplete, $CommandAst, $FakeBoundParams)
$possibleValues = [Google.Apis.Admin.Reports.reports_v1.ActivitiesResource+ListRequest+ApplicationNameEnum].GetEnumNames()
$possibleValues | Where-Object {$_ -like "$WordToComplete*"}
}
)]
[ValidateScript({[Google.Apis.Admin.Reports.reports_v1.ActivitiesResource+ListRequest+ApplicationNameEnum].GetEnumnames()})]
[String]
$ApplicationName = "Admin",
That will use the list from the enum to validate against, and also use it for argument completion (aka pressing Tab).
No description provided.