Platform CLI Add members to Group

When trying to use the Platform CLI (v79.0.0) to add members to a group we are getting the error:
gc.exe : invalid character 'ÿ' looking for beginning of value

PS command: gc.exe groups members add "GroupGUID" -f c:\Temp\group_members.txt
The text file contains:
{
"memberIds": ["UserGUID"],
"version": 1
}

If we use the PS command: $groupJson | gc.exe groups members add "GroupGUID"
To pipe the same request to the command we get the error:
gc.exe : invalid character 'ï' looking for beginning of value

This issue has been validated with multiple users.

Appreciate any help

Hi Ryan

A ticket has been created to track this bug, we'll get one our devs on the case as soon as we can. In the meantime, if we find a workaround we will let you know here.

Thanks for bringing this to our attention.

-Charlie

1 Like

Hi Ryan,

This seems to me like an encoding issue on the text file.
To verify could you try creating a new file manually (on notepad) and then copying over the contents and then using that in place for the cli command?

If that fixed the issue, then it's probably the encoding of the file. This can happen if the file was generated by a separate Powershell script or from a different source.

Please let me know how it goes.

1 Like

Interesting, we use this exact code with a number of CLI commands w/o issue. On your suggestion, I tried with a notepad file and it is working. In PS I updated the Out-File encoding to ASCII and it also works now.
What is weird however, it still doesn't work if we pipe the converted JSON string into the command. I feel like there is still something off about this command as opposed to some of the others.

Thanks for the suggestion, we are able to get this command to work with the code change!

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.