-
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
Get-GSGroup Fields parameter cannot be found #63
Comments
@WToorenburghEasyMarkit thanks for the catch!! I'm on it!! Should 100% be supported so let me make sure that can happen (or figure out barriers at the very least!) |
@WToorenburghEasyMarkit - alright did some digging and found some oddness. The That being said, pushing up a fix in v2.8.1 that blocks use of Fields unless specifying a Group as well via parameter set inclusion to prevent further confusing errors, since Google doesn't appear to support it currently with the List method for Groups Also worth noting: Fields for Google's API's are always mixed camel case, with the first letter always lower case. So your call would need to look something like this otherwise you'll get similar errors (additional corrections on field names): $Fields = @("nonEditableAliases", "description", "email", "kind", "name", "directMembersCount")
$Groups = Get-GSGroup -Group mytestgroup -Fields $Fields |
deployed! Also worth noting that the speed difference between specifying a single field vs having it return all fields is negligible, sometimes even taking longer to return a group with a single field vs just returning all fields: [I ♥ PS 6.0.2] >_ Measure-Command {Get-GSGroup $groupName -Fields 'description'}
Days : 0
Hours : 0
Minutes : 0
Seconds : 0
Milliseconds : 511
Ticks : 5116080
TotalDays : 5.92138888888889E-06
TotalHours : 0.000142113333333333
TotalMinutes : 0.0085268
TotalSeconds : 0.511608
TotalMilliseconds : 511.608
[8] [STATUS: SUCCESS IN 0:00:00.5163 AT 23:16:24 ON 2018-06-28]
~
[I ♥ PS 6.0.2] >_ Measure-Command {Get-GSGroup $groupName}
Days : 0
Hours : 0
Minutes : 0
Seconds : 0
Milliseconds : 458
Ticks : 4580480
TotalDays : 5.30148148148148E-06
TotalHours : 0.000127235555555556
TotalMinutes : 0.00763413333333333
TotalSeconds : 0.458048
TotalMilliseconds : 458.048
[9] [STATUS: SUCCESS IN 0:00:00.4619 AT 23:16:31 ON 2018-06-28]
~
[I ♥ PS 6.0.2] >_ VS [I ♥ PS 6.0.2] >_ Measure-Command {Get-GSGroup $groupName -Fields 'description'}
Days : 0
Hours : 0
Minutes : 0
Seconds : 0
Milliseconds : 477
Ticks : 4777180
TotalDays : 5.52914351851852E-06
TotalHours : 0.000132699444444444
TotalMinutes : 0.00796196666666667
TotalSeconds : 0.477718
TotalMilliseconds : 477.718
[10] [STATUS: SUCCESS IN 0:00:00.4823 AT 23:19:11 ON 2018-06-28]
~
[I ♥ PS 6.0.2] >_ Measure-Command {Get-GSGroup $groupName}
Days : 0
Hours : 0
Minutes : 0
Seconds : 0
Milliseconds : 511
Ticks : 5111990
TotalDays : 5.91665509259259E-06
TotalHours : 0.000141999722222222
TotalMinutes : 0.00851998333333333
TotalSeconds : 0.511199
TotalMilliseconds : 511.199
[11] [STATUS: SUCCESS IN 0:00:00.5157 AT 23:19:14 ON 2018-06-28]
~
[I ♥ PS 6.0.2] >_ |
You are absolutely amazing. Thank you so much for such a quick response, and for making a fantastic PS module! |
I'm glad you like it! Thanks again for submitting the issue to let me know about the bug! |
Hey there,
I'm trying to use
Get-GSGroup
with just theFields
parameter to get all the groups in my org with certain fields. I've got version 2.7.0 of PSGSuite, and I'm running on Windows 10 x64 1803 17134.112, with Powershell version 5.1. This is what I'm trying to run:However, when I run this, Powershell throws an error:
I should note that I'm running this command using a debugging session in Visual Studio Code with the Powershell extension. I did confirm that this error is thrown in a normal Powershell session as well.
When stepping into the execution, I find that, in the
Get-GSGroup
definition, the error gets thrown on line 74, which is callingGet-GSGroupListPrivate
, and that function doesn't have aFields
parameter. Because Get-GSGroups passes$PSBoundParameters
toGet-GSGroupListPrivate
, it throws the parameter cannot be found error.If it's not feasible to have the fields be passed for retreiving all groups, perhaps a more descriptive error would be helpful, as well a note in the docs. Otherwise, I guess this may have been an oversight in the coding process?
Thanks for putting together such an amazing library!
The text was updated successfully, but these errors were encountered: