Hey there,
I'm trying to use Get-GSGroup
with just the Fields
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:
$Fields = @("Aliases", "Description", "EMail", "Kind", "Name", "Members")
$Groups = Get-GSGroup -Fields $Fields
However, when I run this, Powershell throws an error:
Get-GSGroup : A parameter cannot be found that matches parameter name 'Fields'.
At C:\development\ITTools\Projects\Domain and USMT\ImportGroupsFromGSuite.ps1:4 char:11
+ $Groups = Get-GSGroup -Fields $Fields
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Get-GSGroup
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 calling Get-GSGroupListPrivate
, and that function doesn't have a Fields
parameter. Because Get-GSGroups passes $PSBoundParameters
to Get-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!